From owner-freebsd-current Fri Aug 16 6:45:48 2002 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 098F737B430; Fri, 16 Aug 2002 06:45:41 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 847C243E75; Fri, 16 Aug 2002 06:45:39 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id NAA10454; Fri, 16 Aug 2002 13:45:36 GMT Date: Fri, 16 Aug 2002 23:52:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Tim Robbins Cc: Alfred Perlstein , Subject: Re: world broken In-Reply-To: <20020816164813.A62266@dilbert.robbins.dropbear.id.au> Message-ID: <20020816233509.E7073-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Fri, 16 Aug 2002, Tim Robbins wrote: > On Thu, Aug 15, 2002 at 03:18:59PM -0700, Alfred Perlstein wrote: > > > /usr/obj/vol/share/src/i386/usr/include/stdbool.h:41: warning: useless keyword o > > r type name in empty declaration > > /usr/obj/vol/share/src/i386/usr/include/stdbool.h:41: warning: empty declaration > > > I get those a lot now... please fix. > > This happens because GCC 3 doesn't define __STDC_VERSION__ unless > you specify -std=, Also because ru just removed the special gcc hacks for errors in standard headers, so the broken is now detected. gcc 3 doesn't define __STDC_VERSION__ for -std=c89 either. __STDC_VERSION__ is a c99 thing, so this seems right. - whereas 2.95 defines it to 199409L if no > -std option is given. I didn't know that. gcc 2.29 has the interesting bugs of not putting either __STDC__ or __STDC_VERSION__ in gcc -E -dM output, so they are hard to see. - I'm not quite sure how to check for this. Perhaps this > would work: > > #if __STDC_VERSION__ < 199901L && __GNUC__ < 3 > typedef int _Bool; > #endif Seems best. > GCC 3 appears to declare _Bool regardless of any -std option. Even gcc -traditional declares it. This may be a bug. _Bool is in the implementation namespace, but still causes problems (a bit like declaring __STDC__ for nonstandard compilers). We have a hack in related to this. __func__ is a C99 thing, so it should be ifdefed using __STDC_VERSION__, but it is also a gcc thing, so the correct ifdef using __STDC_VERSION__ doesn't work. We handle __restrict/restrict a little differently (probably better). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message