From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3f6848552326c0f6 X-Google-Attributes: gidfee84,public From: Tim Lucia Subject: Re: cc and empty files Date: 1996/12/06 Message-ID: <32A84217.156@zko.dec.com>#1/1 X-Deja-AN: 202700921 references: <57uvru$aon@polaris.eurocontrol.fr> to: Ollivier Robert content-type: text/plain; charset=us-ascii organization: Digital Equipment Corporation, Digital Ladebug Debugger mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 3.0 (X11; I; OSF1 V3.2 alpha) Ollivier Robert wrote: > > Hi, > > I've found that when one is using ``-std1'' on the command line to the > bundled compiler, it refuses to compiles empty files (resulting from > #ifdef...#endif). Is there any way to work around this very annoying > behaviour. from the cc man page: -std[n] Have the compiler produce warnings for language constructs that are not standard in the language. The default is -std0. The -std flag enforces the ANSI C standard with popular extensions. and causes the macro __STDC__=0 to be passed to the preprocessor. The value n can be one of the following: 0 Enforce the K & R standard with some ANSI extensions, and causes the __STDC__ macro to be undefined. 1 Enforce the ANSI C standard and causes the macro __STDC__=1 to be passed to the preprocessor. Note that the -std1 flag also affects linker defined symbols. See the ld(1) reference page for more information. An empty file is not an ANSI C standard file, so either don't use -std1 or have some code in the file which is conditionally included #if __STDC__==1. -- Timothy J. Lucia Digital Ladebug Debugger Developer Digital Equipment Corporation lucia@zko.dec.com 110 Spitbrook Road ZK2-3Q08 Phone: 603.881.2615 Nashua, NH USA 03062-2698 Fax: 603.881.0120