Subject: re: Compiler error messages with HP-UX GCC

From: [email-masked]
Date: Wed, 19 Aug 1998 16:15:29 -0700

Christopher Caldwell <[email-masked]> writes:

> Gregory is correct.

> -Aa is a directive for HP's C/ANSI C compiler, that says
> <SNIP man cc>
>  Compile under ANSI mode (ANSI programming
> language C standard ISO 9899:1990).
...  <snip>

It is more complicated than this.  HP provides a simple cc as part of
the standard installation.  This is the pre-ANSI cc only; it does not
recognize the -Aa flag and will only compile original K&R style programs;
that is, those that use the syntax:
    int main(argc, argv)
    int argc;
    char **argv;

If it is installed, the HP ANSI/ISO C compiler can be invoked either as
cc -Aa or as c89.  This one will compile wuftp.  However, this compiler
does not come as part of the standard installation, and costs extra.  (I
know; I just got through ordering this for an HP-UX 10 system.)

You can also use gcc but, as others have mentioned, many of the compiler
flags are different.  (gcc does not recognize any HP compiler flags which
begin with + rather than -, for instance.)

There is a lot of conditional code in wuftp that apparently allows for
either the old-style pre-ANSI or the newer style compilers.  I gather
that this has not been kept up and now the newer ANSI/ISO compilers
must be used.

Perhaps there should be something in the FAQ about the HP-UX compilers,
the difference between the bare-bones cc and the one that recognizes
cc -Aa, etc., and how to use gcc on HP-UX instead.

-- 
Roger Wells
Sr. Project Engineer, Network Usage Measurement
[email-masked]