Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

how to compile a c program with ANSI options

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
dayanandnaik
Asked:
dayanandnaik
1 Solution
 
dayanandnaikAuthor Commented:
Edited text of question
0
 
mithelCommented:
Just a question which compiler are u using CC or GCC ??
0
 
ozoCommented:
cc -Aa
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ahoffmannCommented:
cc -Aa +a1
# c89 is ansi by default
0
 
elfieCommented:
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
 
braveheartCommented:
What errors are you encountering?
0
 
richardsonjaCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now