From owner-freebsd-current Sat Mar 8 12:40:12 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 81F8C37B404 for ; Sat, 8 Mar 2003 12:40:11 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1ED843FB1 for ; Sat, 8 Mar 2003 12:40:10 -0800 (PST) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 9BB092ED40B; Sat, 8 Mar 2003 12:40:10 -0800 (PST) Date: Sat, 8 Mar 2003 21:40:10 +0100 From: Maxime Henrion To: Garance A Drosihn Cc: Marcel Moolenaar , Garrett Wollman , Craig Rodrigues , freebsd-current@FreeBSD.ORG Subject: Re: #warning must be protected by #if __GNUC__ in headers? Message-ID: <20030308204010.GC3819@elvis.mu.org> References: <20030308161943.GA54921@attbi.com> <200303081728.h28HSDWM039984@khavrinen.lcs.mit.edu> <20030308184834.GC543@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i 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 Garance A Drosihn wrote: > At 2:33 PM -0500 3/8/03, Garance A Drosihn wrote: > > > >By adding that #warning, you are going to have a compile-time error > >on some compilers, whether or not you want it. Hiding it inside of > >an #if/#endif will help for some compilers, but not on all of them. > > Er, I should note that I do like the idea of using #warnings for > some things. All I meant to say was that I would not waste my time > putting it inside of a #if __GNUC__. GNUC is not the only compiler > which understands it, and for some of the compilers which do not > understand it, you're still going to get a compile-time error even > if it's inside that #if/#endif. That's a problem, #warning is not supposed to give a compile-time error but a compile-time warning. The point is moot for the kernel where we use -Werror, but it's very valid for userland. > By putting it inside #if __GNUC__, > you're just confusing things by making it look like the warning > itself is *because of* GCC. Maxime To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message