Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Mar 1997 17:49:30 -0700 (MST)
From:      Nate Williams <nate@mt.sri.com>
To:        Peter Dufault <dufault@hda.com>
Cc:        pst@jnx.com (Paul Traina), hans@brandinnovators.com, bugs@freebsd.org
Subject:   Re: bin/2979: Make gcc shut up about extensions when compiling `-pedantic -ansi'
Message-ID:  <199703140049.RAA02755@rocky.mt.sri.com>
In-Reply-To: <199703132203.RAA07964@hda.hda.com>
References:  <7yhgifihds.fsf@base.jnx.com> <199703132203.RAA07964@hda.hda.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 	When compiling something which uses statement expressions (e.g
> > 	machine/endian.h to get at ntohl()), gcc complains that braces
> > 	are not allowed by ANSI C.
..

> I bumped into this exact problem in the last couple of days and
> removed a -Werror because of it and was glad to see this work around.
> ntohl on a BSD system can't be considered an extension and is well
> enough defined that there is no way that the FreeBSD header should
> generate a warning - that is just going to cause lazy/busy people to
> do what I did and turn off warnings.

----------------------------
rrevision 1.7
date: 1996/10/21 17:15:05;  author: nate;  state: Exp;  lines: +3 -3
When compiling with '-Wall -pedantic', the byte swapping macros gave the
following warning:
  warning: ANSI C forbids braced-groups within expressions

Adding __extension__ before the statement-expression seems to work right.

Submitted by:   bde (a *long* time ago)
----------------------------

It'll be in all releases past this point (assuming we don't make another
2.1.* release.)



Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703140049.RAA02755>