Date: Sat, 22 Jun 2002 20:38:38 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Juli Mallett <jmallett@FreeBSD.ORG> Cc: Doug Barton <DougB@FreeBSD.ORG>, <cvs-committers@FreeBSD.ORG>, <cvs-all@FreeBSD.ORG> Subject: Re: cvs commit: src/usr.sbin/inetd inetd.c Message-ID: <20020622202821.P7645-100000@gamplex.bde.org> In-Reply-To: <20020621195650.A29348@FreeBSD.ORG>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Jun 2002, Juli Mallett wrote: > * Doug Barton <DougB@FreeBSD.org> escriur=E9res > > Bruce Evans wrote: > > > > > > On Fri, 21 Jun 2002, Juli Mallett wrote: > > > > Use __typeof__ instead of typeof. > > > > > > Both of these are gcc features. I prefer typeof since it doesn't giv= e > > > undefined behaviour for non-gcc compilers. > > > > As far as I recall, we still have a long-term project goal of making > > sources that don't depend on gcc to compile, so I'd agree with Bruce > > that this is a bad change. > > I seem to recall using at least one compiler that knew __typeof__ but not > typeof, not to mention that GCC seems to be ignorant that typeof() is a > builtin, but not __typeof__(), and therefore will emit bogus warnings. I think gcc emits non-bogus warnings about typeof() because you asked it to by setting WARNS to >=3D 5 to make gcc more standard. typeof() is just a function call in Standard C, so typeof(a) cannot possibly be part of a declaration like it needs to be in the SWAP() macro. Portable code would use __typeof__() inside a __GNUC__ ifdef for the gcc case and something else for the non-gcc case, or just something else in all cases. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020622202821.P7645-100000>