Solved

how to compile a c program with ANSI options

Posted on 1999-01-07
7
262 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

911 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

19 Experts available now in Live!

Get 1:1 Help Now