From owner-freebsd-current Sat Mar 8 10: 6:51 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AF0F37B401 for ; Sat, 8 Mar 2003 10:06:50 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F54243FBD for ; Sat, 8 Mar 2003 10:06:49 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.7/8.12.7) id h28I6k0v066167; Sat, 8 Mar 2003 12:06:46 -0600 (CST) (envelope-from dan) Date: Sat, 8 Mar 2003 12:06:46 -0600 From: Dan Nelson To: Garrett Wollman Cc: Craig Rodrigues , freebsd-current@FreeBSD.ORG Subject: Re: #warning must be protected by #if __GNUC__ in headers? Message-ID: <20030308180646.GB7151@dan.emsphone.com> References: <20030308161943.GA54921@attbi.com> <200303081728.h28HSDWM039984@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200303081728.h28HSDWM039984@khavrinen.lcs.mit.edu> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.3i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Mar 08), Garrett Wollman said: > On Sat, 8 Mar 2003 11:19:43 -0500, Craig Rodrigues 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