From owner-cvs-src@FreeBSD.ORG Fri Oct 31 04:15:46 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A3D216A4CE; Fri, 31 Oct 2003 04:15:46 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7AF543FCB; Fri, 31 Oct 2003 04:15:43 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id XAA00372; Fri, 31 Oct 2003 23:15:41 +1100 Date: Fri, 31 Oct 2003 23:15:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Peter Wemm In-Reply-To: <200310310542.h9V5gr8v023991@repoman.freebsd.org> Message-ID: <20031031230028.K1418@gamplex.bde.org> References: <200310310542.h9V5gr8v023991@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/sys cdefs.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2003 12:15:46 -0000 On Thu, 30 Oct 2003, Peter Wemm wrote: > peter 2003/10/30 21:42:53 PST > > FreeBSD src repository > > Modified files: > sys/sys cdefs.h > Log: > While not illegal, attempt to pacify gcc -Wundef. It just so happens > that libtool-using packages seem to love using this flag. > > /usr/include/sys/cdefs.h:184:5: warning: "__STDC_VERSION__" is not defined > /usr/include/sys/cdefs.h:372:5: warning: "_POSIX_C_SOURCE" is not defined > /usr/include/sys/cdefs.h:378:5: warning: "_POSIX_C_SOURCE" is not defined It (this pacification, not the previous version) is illegal (in my style rules :-). Please back this out. The bug seems to be mainly in: %%% RCS file: /home/ncvs/src/contrib/gcc/toplev.c,v Working file: toplev.c head: 1.22 ... ---------------------------- revision 1.22 date: 2003/08/22 03:31:54; author: kan; state: Exp; lines: +2 -2 Enable warn_system_heders by default. ---------------------------- Index: toplev.c =================================================================== RCS file: /home/ncvs/src/contrib/gcc/toplev.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -2 -r1.21 -r1.22 --- toplev.c 22 Aug 2003 03:13:20 -0000 1.21 +++ toplev.c 22 Aug 2003 03:31:54 -0000 1.22 @@ -20,5 +20,5 @@ 02111-1307, USA. */ -/* $FreeBSD: src/contrib/gcc/toplev.c,v 1.21 2003/08/22 03:13:20 kan Exp $ */ +/* $FreeBSD: src/contrib/gcc/toplev.c,v 1.22 2003/08/22 03:31:54 kan Exp $ */ /* This is the top level of cc1/c++. @@ -1411,5 +1411,5 @@ /* Don't suppress warnings from system headers. -Wsystem-headers. */ -int warn_system_headers = 0; +int warn_system_headers = 1; /* Print various extra warnings. -W. */ %%% This bogotifies enabling this warning when WARNS > 0 (by always enabling it by default): %%% RCS file: /home/ncvs/src/share/mk/bsd.sys.mk,v Working file: bsd.sys.mk head: 1.32 ... ---------------------------- revision 1.12 date: 2003/03/31 13:10:51; author: ru; state: Exp; lines: +1 -0 Enable cpp(1) warnings in system headers. GCC is oriented on glibc which is externally maintained, so GCC ships with these warnings turned off by default. This is also consistent with the src/contrib/gcc/c-lex.c,v 1.2 change. ---------------------------- Index: bsd.sys.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.sys.mk,v retrieving revision 1.11 retrieving revision 1.12 diff -u -2 -r1.11 -r1.12 --- bsd.sys.mk 13 Nov 2002 13:49:29 -0000 1.11 +++ bsd.sys.mk 31 Mar 2003 13:10:51 -0000 1.12 @@ -1,3 +1,3 @@ -# $FreeBSD: src/share/mk/bsd.sys.mk,v 1.11 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/share/mk/bsd.sys.mk,v 1.12 2003/03/31 13:10:51 ru Exp $ # # This file contains common settings used for building FreeBSD @@ -12,4 +12,5 @@ . if defined(WARNS) . if ${WARNS} > 0 +CFLAGS += -Wsystem-headers . if !defined(NO_WERROR) CFLAGS += -Werror %%% While it is good to check for warnings in system headers, this shouldn't be forced on everyone. Applications that want to check for the non-error of using undefined identifiers in cpp expressions shouldn't enable warnings in system headers unless they want to get warnings if the headers use this standard C feature (and other warnings). Applications in the src tree won't do this. Bruce