Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Oct 2003 14:31:29 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Peter Wemm <peter@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/sys cdefs.h
Message-ID:  <20031031123129.GB777@sunbay.com>
In-Reply-To: <20031031230028.K1418@gamplex.bde.org>
References:  <200310310542.h9V5gr8v023991@repoman.freebsd.org> <20031031230028.K1418@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--KFztAG8eRSV9hGtP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 31, 2003 at 11:15:40PM +1100, Bruce Evans wrote:
> On Thu, 30 Oct 2003, Peter Wemm wrote:
>=20
> > 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 de=
fined
> >   /usr/include/sys/cdefs.h:372:5: warning: "_POSIX_C_SOURCE" is not def=
ined
> >   /usr/include/sys/cdefs.h:378:5: warning: "_POSIX_C_SOURCE" is not def=
ined
>=20
> It (this pacification, not the previous version) is illegal (in my style
> rules :-).  Please back this out.
>=20
> The bug seems to be mainly in:
>=20
> %%%
> 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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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.  */
>=20
> -/* $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=
 $ */
>=20
>  /* This is the top level of cc1/c++.
> @@ -1411,5 +1411,5 @@
>  /* Don't suppress warnings from system headers.  -Wsystem-headers.  */
>=20
> -int warn_system_headers =3D 0;
> +int warn_system_headers =3D 1;
>=20
>  /* Print various extra warnings.  -W.  */
> %%%
>=20
> This bogotifies enabling this warning when WARNS > 0 (by always enabling
> it by default):
>=20
> %%%
> 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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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		+=3D	-Wsystem-headers
>  .   if !defined(NO_WERROR)
>  CFLAGS		+=3D	-Werror
> %%%
>=20
> 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.
>=20
What's the underlying issue here?  I always thought that FreeBSD is differe=
nt
=66rom GNU is this respect -- we treat our system as the whole, so the piece
of code is as clean as its worst part; that may be a system header, too.
Remember the issue?  Old versions of buildworld used -nostdinc hack and
-I... to ${WORLDTMP}/usr/include, and it caused WARNS to be generating
different warnings while in buildworld compared to a normal (no -nostdinc)
build.  I'm against reverting the toplev.c change, but it also made the
sys.mk part redundant, so the latter may be reverted now.


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software Ltd,
ru@FreeBSD.org		FreeBSD committer

--KFztAG8eRSV9hGtP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD4DBQE/olYhUkv4P6juNwoRAp8PAJiSLqqljx6lwOKnxFhedvBhY7Q7AJ484Yke
TFbYc4tH3MeWmfm0gjTxZA==
=6k+/
-----END PGP SIGNATURE-----

--KFztAG8eRSV9hGtP--



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