[comp.lang.c] novice's question about GCC and MAKEDEPEND

luj@delta.ecn.purdue.edu (Jun Lu) (10/31/90)

Hi, 

I'm the first time novice gcc user -- I just want to try it out to compile
the X application programs(these  programs have been compiled using cc with no
problem) on Sun3/60, running SunOS4.0.3.

I specified "-tradtional" option to the gcc compiler. I also modified main.c
for makedpend so that makedepend will include first /usr/unsup/lib/gcc-include
( gcc here is installed under dir /usr/unsup/lib --local specifics ) then 
/usr/include in addition to the -Idirs passed to makedepend.

Now the problem comes: makedepend generates dependencies like
/usr/unsup/lib/gcc-include/math.h( which in turn includes math-68881.h).  
Since "-tradtional" was specified to gcc, keywords like "volatile" in
/usr/unsup/lib/gcc-include/math-68881.h were not recognized by gcc, as
on-line gcc man pages say.  gcc complains and emits a series of errors. 
Following is briefly what I did:
---
gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -fwritable-strings
-traditional -B/usr/unsup/lib/gcc- -O   -I. -sun3 -c foo.c

In file included from /usr/unsup/lib/gcc-include/math.h, from foo.c:24:
/usr/unsup/lib/gcc-include/math-68881.h:36: parse error before `double'
...
/usr/unsup/lib/gcc-include/math-68881.h:364: parse error before `volatile
...
---
However, if I ask gcc searches /usr/include first, gcc won't complain at all.
.i.e.
---
gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -fwritable-strings
-traditional -B/usr/unsup/lib/gcc- -I/usr/include -O   -I. -sun3 -c
vweiner.c
----
works fine.( and later can be linked with no problem ).


Does this mean that if "-tradtional" is specified to gcc, gcc should be
dircted to search /usr/include prior to searching (/usr/unsup/lib/)gcc-include
? ( Also overwrites the dependencies generated by makedepend ? ) 
What is gcc-include used for ?( ANSI C ? ) Under what circumstance should 
gcc-specific includes (/usr/unsup/lib/)gcc-include take precedence over the 
standard includes /usr/include ?  

Do I simply miss something ?

Please reply to me directly. If there is enough interest, I'll post a summary.

Thanks in advance.
--
-- Jun Lu                          Internet:luj@ecn.purdue.edu          --
-- Aeronautics & Astronautics      Bitnet:  luj%ecn.purdue.edu@purccvm  --
-- Purdue University		   UUCP:    pur-ee!luj                  -- 
-- W. Lafayette, IN 47907          Phone:317-494-9410  Fax:317-494-0307 --