Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Mar 2003 10:48:34 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        Craig Rodrigues <rodrigc@attbi.com>, freebsd-current@FreeBSD.ORG
Subject:   Re: #warning must be protected by #if __GNUC__ in headers?
Message-ID:  <20030308184834.GC543@dhcp01.pn.xcllnt.net>
In-Reply-To: <200303081728.h28HSDWM039984@khavrinen.lcs.mit.edu>
References:  <20030308161943.GA54921@attbi.com> <200303081728.h28HSDWM039984@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 08, 2003 at 12:28:13PM -0500, Garrett Wollman wrote:
> 
> `#if __GNUC__' wouldn't help matters; every preprocessor has to read
> and interpret every preprocessor directive (so that `#else' and
> `#endif' can be recognized).

I don't think preprocessors should interpret directives when they are
dead (ie part of an #if block or #else block that is not to be compiled).
They should merely scan the block for #else, #endif and the likes to keep
track of nesting, but should otherwise ignore anything it sees. For how
does it matter if a directive is valid or invalid when you're not acting
upon it anyway? One can even claim that emitting an error or warning *is*
reaction upon the directive.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030308184834.GC543>