Date: Tue, 1 May 2018 21:53:03 +0000 From: Brooks Davis <brooks@freebsd.org> To: Bruce Evans <brde@optusnet.com.au> Cc: John Baldwin <jhb@freebsd.org>, arch@freebsd.org Subject: Re: LIBC_SCCS Message-ID: <20180501215303.GA4870@spindle.one-eyed-alien.net> In-Reply-To: <20180428110152.Q4737@besplex.bde.org> References: <1711113.VelFtdTVS7@ralph.baldwin.cx> <20180428110152.Q4737@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 28, 2018 at 11:39:02AM +1000, Bruce Evans wrote: > On Fri, 27 Apr 2018, John Baldwin wrote: >=20 > > I suspect no one cares, but for whatever reason our current handling of= the > > LIBC_SCCS macro in some of our libraries annoys me. In theory it seems= like > > LIBC_SCCS's purpose is to control whether or not old SCCS IDs from Berk= eley > > are included in libc's sources when libc is built. (Similar to how mac= ros > > control the behavior of __FBSDID().) However, we use an odd construct = in > > the tree. First, we define LIBC_SCCS by default in the CFLAGS of vario= us > > libraries (libkvm, libutil, libthr, libc, etc.) which in theory would e= nable > > the IDs, but then we explicitly wrap them in #if 0, e.g.: > > > > #if defined(LIBC_SCCS) && !defined(lint) > > #if 0 > > static char sccsid[] =3D "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; > > #endif > > #endif /* LIBC_SCCS and not lint */ >=20 > Most aren't actually wrapped with '#if 0'. E.g., in libc/*/*.c there are > 839 files but only 47 of these have any '#if 0' at all. SO this can be > fixed without much churn. >=20 > I thought there is a problem with the above not actually compiling if > LIBC_SCCS is defined, but WARNS is only 2 for libc and it takes WARNS >= =3D 4 > to give -Wwrite-strings. At higher WARNS levels the ones without #if 0 also warn about unused static variable. If we're going to keep them, using an __FBSDID()-like macro seems like the best option so that's easy to make correct and doesn't require churn if compilers change. -- Brooks --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa6OG/AAoJEKzQXbSebgfAqt4IAJIrvHBMRE6LWfgozri+nN3U i42IdwC6xt/n/FScwe5beM6uaOoIFxwLSZOAZENXqwqVPWt1l1QnVqQ4TJxsTNuZ aAIg/QamwW+0ruHPThezgU1zPD2oRgnTKcXOf0REXRPRm681IwHAVHGNi6lzFq8t AFGwkHJ6AXW/37k4NG/EQfSREMa2n7zWfwEF1YQ8emsITprK0BNXu7zbJp9S+iKY vTkEg94vukCPSLajyGPovxLPpn8r/tn1fyaKec6MlasihM+hyYdT7Lz+gKNZdyzP 0V7nxg/VlInAJBCF+DEkMab0mHT25d8wXl/nbKCL4YuLfOnPLcBxb4PNT48W7NQ= =qa0X -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180501215303.GA4870>