Solved

how to compile a c program with ANSI options

Posted on 1999-01-07
7
268 Views
Last Modified: 2010-04-15
I have a c program in ANSI, to be compiled in HP-UNIX 10.0 i have tired most of the options be could not get through, Could some one Help in this?
0
Comment
Question by:dayanandnaik
7 Comments
 

Author Comment

by:dayanandnaik
ID: 1255587
Edited text of question
0
 

Expert Comment

by:mithel
ID: 1255588
Just a question which compiler are u using CC or GCC ??
0
 
LVL 84

Expert Comment

by:ozo
ID: 1255589
cc -Aa
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 1255590
cc -Aa +a1
# c89 is ansi by default
0
 
LVL 3

Expert Comment

by:elfie
ID: 1255591
When using some HP extensions

cc -Aa -D_HPUX_SOURCE

perhaps add others defines like
-D_POSIX_SOURCE
-D_XOPEN_SOURCE
-D_XPG2
depending on which functions you're using
0
 
LVL 3

Expert Comment

by:braveheart
ID: 1255592
What errors are you encountering?
0
 

Accepted Solution

by:
richardsonja earned 0 total points
ID: 1255593
Just to tie up the other answers here:

1) Unless you have bought the ANSI/C compiler, the short answer is : you can't (You can tell this by specifying the -Aa or -Ae options... you will get an error message if you are using the cc_bundled)

2) -Aa enables ansi compilation
   -Ae enables anis, with certain HP specific options (long pointers, $ in identifier, long long type)

   You may also want to set one of the following
    -D_HPUX_SOURCE
    -D_XOPEN_SOURCE
    -D_POSIX_SOURCE

Depending on what you want to compile.....(for any system stuff (sockets......) you will need to use _HPUX_SOURCE

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to design, and implement simple interface 5 135
why "." vs "->" 23 120
Passing a array as parameter - C 2 96
xamarin c# deserialize Json containing nested object 2 97
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question