From owner-freebsd-bugs Thu Mar 13 16:49:56 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA01359 for bugs-outgoing; Thu, 13 Mar 1997 16:49:56 -0800 (PST) Received: from rocky.mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA01350 for ; Thu, 13 Mar 1997 16:49:43 -0800 (PST) Received: (from nate@localhost) by rocky.mt.sri.com (8.7.5/8.7.3) id RAA02755; Thu, 13 Mar 1997 17:49:30 -0700 (MST) Date: Thu, 13 Mar 1997 17:49:30 -0700 (MST) Message-Id: <199703140049.RAA02755@rocky.mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Peter Dufault 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' In-Reply-To: <199703132203.RAA07964@hda.hda.com> References: <7yhgifihds.fsf@base.jnx.com> <199703132203.RAA07964@hda.hda.com> Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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