Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Mar 2003 12:06:46 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
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:  <20030308180646.GB7151@dan.emsphone.com>
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
In the last episode (Mar 08), Garrett Wollman said:
> On Sat, 8 Mar 2003 11:19:43 -0500, Craig Rodrigues <rodrigc@attbi.com> said:
> > Does the use of #warning need to be protected by
> > #if __GNUC__ in FreeBSD header files?
> 
> No, it needs to be replaced by the standard `#error' directive
> instead.  I asked portmgr to do a run on the portsd cluster with this
> change to look for ports that mistakenly include this file, but I
> never heard back and portmgr is now busy doing the packages for 4.8.
> 
> `#if __GNUC__' wouldn't help matters; every preprocessor has to read
> and interpret every preprocessor directive (so that `#else' and
> `#endif' can be recognized).

This was discussed on the tendra list, and it was determined that the
preprocessor should not complain about unknown directives at all and
should pass them unchanged to the compiler.

http://lists.tendra.org/tendra-dev/20021215/msg00005.html

If the #warning directive is wrapped with an appropriate #if SOMETHING
conditional to hide it from compilers that do not understand it, it
should be okay.


-- 
	Dan Nelson
	dnelson@allantgroup.com

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?20030308180646.GB7151>