Solved

how to compile a c program with ANSI options

Posted on 1999-01-07
7
259 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now