Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!romp!auschs!awdprime!engshien!eswu From: eswu@engshien.uucp (Eng-Shien Wu/16000000) Newsgroups: comp.sys.ibm.pc.rt Subject: Re: cpp problem on RS6000 Keywords: cpp, RIOS Message-ID: <3344@awdprime.UUCP> Date: 31 Aug 90 23:25:33 GMT References: <1990Aug31.184126.26314@caen.engin.umich.edu> Sender: news@awdprime.UUCP Reply-To: eswu@ub.cc.umich.edu Distribution: usa Organization: IBM AWD, Austin, TX Lines: 52 The Risc System/6000 uses an ANSI-compatible cpp where the following line is not legal: /**/ #it thinks this is a macro statement, because they can start anywhere The solution is to use the cpp in /usr/lpp/X11/Xamples/util/cpp/cpp. An excerpt from the document "Porting 4.3 BSD Programs to AIX Version 3.1": --------------------------------------------------------------------------- 5.2. /lib/cpp /lib/cpp is not the Kernighan & Ritchie cpp. In- stead, it is the same preprocessor as the AIXv3.1 C compiler uses, but externalized, and it uses a default language level of extended. For example, /lib/cpp does not have to start preprocessor mac- ros in the first column (mandated by ANSI C), but any text after an #endif is ignored (not allowed by ANSI C). The flags -tp -B/path/ can be used as compiler arguments to cause /path/cpp to be used for preprocessing the source file (see below). For example, to compile a single C source program, file.c, using /lib/cpp instead of the C compiler's built-in preprocessor, use: cc -tp -B/lib/ file.c See the InfoExplorer documentation in Appendix A. of the XL C Reference Manual for more information about language levels. 5.3. Kernighan & Ritchie cpp Because there are many programs, specifically X11 programs, that rely on the behavior of the K&R C preprocessor, this has been provided in /usr/lpp/X11/Xamples/util/cpp/cpp. To get this used as the C preprocessor, you need to have the X11 Development LPP installed and invoke it directly, use the flags -tp -B/usr/lpp/X11/Xamples/util/cpp/ with the com- piler, or modify the /etc/xlc.cfg stanza as men- tioned above. --------------------------------------------------------------------------- -- Eng-Shien Wu, "My views only" X Windows, IBM Advanced Workstations Div, Austin, Texas Internet: eswu@ub.cc.umich.edu VNET: ausvmq(engshien)