From owner-cvs-all Sat Jun 22 3:33:47 2002 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id A194437B400; Sat, 22 Jun 2002 03:33:42 -0700 (PDT) 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 UAA01122; Sat, 22 Jun 2002 20:33:39 +1000 Date: Sat, 22 Jun 2002 20:38:38 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Juli Mallett Cc: Doug Barton , , Subject: Re: cvs commit: src/usr.sbin/inetd inetd.c In-Reply-To: <20020621195650.A29348@FreeBSD.ORG> Message-ID: <20020622202821.P7645-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 21 Jun 2002, Juli Mallett wrote: > * Doug Barton 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