Date: Tue, 28 Aug 2001 11:04:17 +0200 From: Erik Trulsson <ertr1013@student.uu.se> To: freebsd-hackers@freebsd.org Subject: Re: Portability of #warning in /usr/include Message-ID: <20010828110417.A84786@student.uu.se> In-Reply-To: <08e601c12f62$c48b79a0$6c456420@mdaxke> References: <08e601c12f62$c48b79a0$6c456420@mdaxke>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 27, 2001 at 06:42:28PM -0700, Mark D. Anderson wrote: > > This may not work. > >... > > Some of those compilers > > would NOT let you '#ifdef' out the version that it did not recognize > > (perhaps thinking that '#warn' or '#warning' might be some gross typo > > for '#else' or '#endif', I guess...). > > this is true; some compilers seem to require that #ifdef'd out code be syntactically correct. I think that the ISO C standard requires that all the code, including #ifdef'd out code, must consist of valid preprocessor tokens. The preprocessor must after all look at the #ifdef'd out code to determine where the #ifdef ends. So, having a line start with '#' without being a valid preprocessor directive would be a syntax error according to ISO C. -- <Insert your favourite quote here.> Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010828110417.A84786>