1820227 Members
3476 Online
109620 Solutions
New Discussion юеВ

Re: aCC compiler ?

 
SOLVED
Go to solution
Sir T S S
Advisor

aCC compiler ?

hi to all,

May i know can we use the aCC which the HP c++ compiler to compile C program , i try but some function deprecated message thrown out, some function not defined.

help needed.

thanks.
5 REPLIES 5
VEL_1
Valued Contributor

Re: aCC compiler ?

Hello,

In HP-UX, you shouldn't use aCC for both C & C++ applications. you have to use corresponding compilers for applications.

C - CC Or gcc
C++ - aCC

Note:
In Linux, there is only one compiler for both C and C++.

- Durai.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: aCC compiler ?

Nonsense, aCC is perfectly capable of compiling C and C++. The C must be ANSI/C because aCC will not accept K&R syntax.

You are finding that aCC is pickier about function usages and older/questionable constructs. The functions not defined means that header files are missing or the linker can find the function in the list of libraries and objects that you supplied to the command. You can also control the warning with -Ae or -Aa options and you have the ability to suppress specific warnings but normally the better answer is to modernize your syntax.
If it ain't broke, I can fix that.
Sir T S S
Advisor

Re: aCC compiler ?

hey clay,

you are right, i try the aCC -Ae -O sample.c then it work , you are right but what is the K&R syntax?
A. Clay Stephenson
Acclaimed Contributor

Re: aCC compiler ?

You need to hang your head in shame; you are not allowed to call yourself a C programmer.
Go directly to jail; do not pass Go; do not collect $200.00.

K&R refers to "Brian W. Kernighan" and "Dennis M. Ritchie"; they wrote the first widely available description of the C language. Do a google search on either of these and you will get many, many hits -- plus references to their book.

K&R C looks like this:
int main(argc,argv)
int argc;
char *argv[];
{

}

whereas the newer ANSI/C looks like this:

int main(int argc; char *argv[])
{

}

Also, have you ever heard of a little utility called "awk". I'll give you one guess
as to who the "k" represents.
If it ain't broke, I can fix that.
Sir T S S
Advisor

Re: aCC compiler ?

ok ack.