[comp.sys.next] cc -traditional problem

rbp@investor.pgh.pa.us (Bob Peirce #305) (01/31/91)

I was moving over some scripts from the old system and in testing
discovered NeXT's awk is oawk, so I decided to port nawk.  It wouldn't
compile so I went to the manual and discovered this might be because
externs were mentioned inside functions and I probably needed the
-traditional flag.  When I tried that, the compiler croaked on problems
with stdio.h.  It didn't like the concept of const whatever.  Now that
seems pretty dumb.  Why provide a flag that is needed but can't be used?
This suggests I am missing something, but I don't know what.  Do you?

BTW, why is there no lint?  Are the compiler messages considered to be
just as good?

-- 
Bob Peirce, Pittsburgh, PA				  412-471-5320
...!uunet!pitt!investor!rbp			rbp@investor.pgh.pa.us

melling@cs.psu.edu (Michael D Mellinger) (02/01/91)

In article <1991Jan31.115059.12153@investor.pgh.pa.us> rbp@investor.pgh.pa.us (Bob Peirce #305) writes:

   I was moving over some scripts from the old system and in testing
   discovered NeXT's awk is oawk, so I decided to port nawk.  It wouldn't
   compile so I went to the manual and discovered this might be because
   externs were mentioned inside functions and I probably needed the
   -traditional flag.  When I tried that, the compiler croaked on problems
   with stdio.h.  It didn't like the concept of const whatever.  Now that
   seems pretty dumb.  Why provide a flag that is needed but can't be used?
   This suggests I am missing something, but I don't know what.  Do you?

To use the -traditional switch, you can try copying the stdio.h file
to another directory, removing the const keyword, and then including
that directory with the -I option.  I got a stdio.h from a Sun 3.  I
can't remember if removing the word const is enough.  Hopefully, NeXT
will get around to changing stdio.h in the next release.

   BTW, why is there no lint?  Are the compiler messages considered to be
   just as good?

Try cc -Wall -O.  The GNU compiler gives decent warnings.  As far as I
know, lint doesn't even work with ANSI C, let alone Objective C.

-Mike

jacob@gore.com (Jacob Gore) (02/01/91)

/ comp.sys.next / rbp@investor.pgh.pa.us (Bob Peirce #305) / Jan 31, 1991 /
> I decided to port nawk.

Last I checked, nawk was very unportable.  I use gawk (the GNU awk)
instead.  Available from prep.ai.mit.edu, as is all GNU stuff, and you
don't need the AT&T source license.

> I probably needed the -traditional flag.
> When I tried that, the compiler croaked on problems with stdio.h.

Use the -bsd flag instead.

Jacob
--
Jacob Gore		Jacob@Gore.Com			boulder!gore!jacob