This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cpp doesn't define symbol i386


> [regarding using a small shell script wrapper as 'cpp':]
>  
> > "gcc -E" is not equivalent to cpp because cpp read from stdin by default
> > and "gcc -E" needs the parameter "-" to force reading from stdin. But
> > hardcoding "-" in a shellscript will not be a solution due to cases where
> > cpp is called with an inputfile. Is it possible to change the behavior of
> > "gcc -E" so that it reads from stdin by default? 
> 
> does this do the trick?
> 
>    #!/bin/bash
>    gcc -E ${*:-'-'}

Problem: what if there are command line options, like -I/foo/bar or
-Dfoo=bar?  Here's what I use:

#!/bin/sh
exec `gcc -print-prog-name=cpp` -traditional ${1+"$@"}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]