*Please read and reply* Using cpp to preprocess files (was: Re:bug in the class browser)

holle at almaden.ibm.com holle at almaden.ibm.com
Fri Jun 18 22:03:42 BST 1999



Can you tell us what the compilers did resp. what the manpage tells about the
switches, so we can see if we can use the -E -P -C siwtches ?

-holger


Massimo Morin <mmorin at schedsys.com> on 18/06/99 13:35:13

Please respond to kdevelop at fara3.cs.uni-potsdam.de

To:   kdevelop at fara3.cs.uni-potsdam.de
cc:    (bcc: Holger Lehmann/Almaden/Contr/IBM)
Subject:  Re: *Please read and reply* Using cpp to preprocess files (was: Re:bug
      in the class browser)





Hi,
     I have Linux, SunOS 5.5.1, HP-UX 10.20 and AIX.
You tested on AIX, Solaris (SunOS) and  Linux.
So
HP-UX
c89 -E --> Ok
c89 -C --> No! (ignore it!)
c89 -CE --> Ok
c89 -C -E ok
c89 -P --> No! (ignore it!)
c89 -EP --> Ok
c89 -E -P --> ok
c89 -E -P -C --> Ok

// this is the C++ compiler
aCC -E  --> ok
aCC -C --> No! (ignore it!)
aCC -CE --> No! (ignore it!)
aCC -C -E --> No! (after error it works as -E)
aCC -P --> No! (it compiles)
aCC -EP --> No! (it compiles)
aCC -P -E --> No! (it compiles)
aCC -E -P -C --> No! (error -C not recornize)

// gcc -v
// Reading specs from
/usr/local/lib/gcc-lib/hppa1.0-hp-hpux10.20/2.7.2.1/specs
// gcc version
2.7.2.1
gcc -E --> Ok

g++ -E --> Ok
g++ -C --> No (not supported without -E)
g++ -CE --> No Error
g++ -E -C --> Ok
g++ -P --> no (it compiles)
g++ -EP --> no (unrecognized)
g++ -E -P --> ok
g++ -E -P -C --> ok

Hope this help, and if you need more details let me know!

Cheers
     Massimo


holle at almaden.ibm.com wrote:
>
> I think all compilers accept the -E switch. This should give us expanded
macros,
> line number information and no comments.
> Lets see, ... my Linux system does exactly this ... AIX is doing it as well
with
> its own cc or xlc or c89. As far as I remember Solaris own cc did it this way,
> too.
>
> All of you out there, please check what the switches   -E   -P   -C are doing
on
> *your* non-Linux box.
> Here is what gcc/cpp does:
> -E    preprocess only
> -C    leave comments in the preprocessed file
> -P    do *not* put #line and #file information in the preprocessed file
>
> -holger
>
> Jonas Nordin <jonas.nordin at cenacle.se> on 17/06/99 06:12:44
>
> Please respond to kdevelop at fara3.cs.uni-potsdam.de
>
> To:   kdevelop at fara3.cs.uni-potsdam.de
> cc:    (bcc: Holger Lehmann/Almaden/Contr/IBM)
> Subject:  Re: bug in the class browser
>
> > But tie Kdevelop directly to gcc. My understanding of KDE in general  is
that
> it
> > is for all Unix platforms, not just Linux/FreeBSD/GNU based systems.
> > Unfortunate for those people wanting to use the native compilers on Solaris
or
> > IRIX etc..The Solaris cpp for one does not support anything like -dM
according
> > to the manual page.
>
> I guess you're right. The problem with gcc (as far as I know) is that just
doing
> macro expansions isn't possible. *sigh* Guess we need some other solution to
> this.
> Perhaps there is some simple preparser we can use. :-(
>
> /J

--
Massimo Morin        | Scheduling Systems Inc.
Software Engineer    |
-------------------  | Three University Office Park, suite 100
13, Charnwood Rd     | 95 Sawyer Road
Somerville 02144 MA  | Waltham,
-------------------  | 02453 Massachusetts
+1 (617) 623-4155    | +1 (781) 893-0390
mmorin at schedsys.com  | http://www.schedsys.com
----------------------------------------------------------------------
Never attribute to malice that which can be adequately explained by
stupidity.






More information about the KDevelop mailing list