?
Solved

how to compile a c program with ANSI options

Posted on 1999-01-07
7
Medium Priority
?
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

764 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