From owner-freebsd-hackers Tue Aug 28 2: 4:42 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from maild.telia.com (maild.telia.com [194.22.190.101]) by hub.freebsd.org (Postfix) with ESMTP id 1B29137B406 for ; Tue, 28 Aug 2001 02:04:39 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by maild.telia.com (8.11.2/8.11.0) with ESMTP id f7S94bM02239 for ; Tue, 28 Aug 2001 11:04:37 +0200 (CEST) Received: from ertr1013.student.uu.se (h185n2fls20o913.telia.com [212.181.163.185]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id LAA04754 for ; Tue, 28 Aug 2001 11:04:33 +0200 (CEST) Received: (qmail 91680 invoked by uid 1001); 28 Aug 2001 09:04:17 -0000 Date: Tue, 28 Aug 2001 11:04:17 +0200 From: Erik Trulsson To: freebsd-hackers@freebsd.org Subject: Re: Portability of #warning in /usr/include Message-ID: <20010828110417.A84786@student.uu.se> Mail-Followup-To: freebsd-hackers@freebsd.org References: <08e601c12f62$c48b79a0$6c456420@mdaxke> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08e601c12f62$c48b79a0$6c456420@mdaxke> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message