From owner-freebsd-arch@freebsd.org Tue May 1 21:53:12 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62B6FB905F for ; Tue, 1 May 2018 21:53:11 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 792347C2A2 for ; Tue, 1 May 2018 21:53:11 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by mailman.ysv.freebsd.org (Postfix) id 35A12FB905E; Tue, 1 May 2018 21:53:11 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 242BBFB905C for ; Tue, 1 May 2018 21:53:11 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD1567C2A0; Tue, 1 May 2018 21:53:10 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id AE1CC5A9F12; Tue, 1 May 2018 21:53:03 +0000 (UTC) Date: Tue, 1 May 2018 21:53:03 +0000 From: Brooks Davis To: Bruce Evans Cc: John Baldwin , arch@freebsd.org Subject: Re: LIBC_SCCS Message-ID: <20180501215303.GA4870@spindle.one-eyed-alien.net> References: <1711113.VelFtdTVS7@ralph.baldwin.cx> <20180428110152.Q4737@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <20180428110152.Q4737@besplex.bde.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2018 21:53:12 -0000 --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--