From owner-freebsd-arch@freebsd.org Thu May 17 00:26:18 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 9E087EE079A for ; Thu, 17 May 2018 00:26:18 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 3C15385F68 for ; Thu, 17 May 2018 00:26:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id F3E03EE0793; Thu, 17 May 2018 00:26:17 +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 E11C1EE0792 for ; Thu, 17 May 2018 00:26:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 952D785F66; Thu, 17 May 2018 00:26:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 58AC9D10F; Thu, 17 May 2018 00:26:17 +0000 (UTC) (envelope-from jhb@freebsd.org) From: John Baldwin To: Brooks Davis Cc: Bruce Evans , arch@freebsd.org Subject: Re: LIBC_SCCS Date: Wed, 16 May 2018 14:00:54 -0700 Message-ID: <6859500.cJmFvTkEvq@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180501215303.GA4870@spindle.one-eyed-alien.net> References: <1711113.VelFtdTVS7@ralph.baldwin.cx> <20180428110152.Q4737@besplex.bde.org> <20180501215303.GA4870@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 00:26:18 -0000 On Tuesday, May 01, 2018 09:53:03 PM Brooks Davis wrote: > On Sat, Apr 28, 2018 at 11:39:02AM +1000, Bruce Evans wrote: > > On Fri, 27 Apr 2018, John Baldwin wrote: > > > > > 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 Berkeley > > > are included in libc's sources when libc is built. (Similar to how macros > > > 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 various > > > libraries (libkvm, libutil, libthr, libc, etc.) which in theory would enable > > > the IDs, but then we explicitly wrap them in #if 0, e.g.: > > > > > > #if defined(LIBC_SCCS) && !defined(lint) > > > #if 0 > > > static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; > > > #endif > > > #endif /* LIBC_SCCS and not lint */ > > > > 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. > > > > 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 >= 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. I have a review for libkvm (which has many smaller examples than libc) at https://reviews.freebsd.org/D15459 for any folks who are interested. It uses __SCCSID() but then disables them by default via -DNO__SCCSID. -- John Baldwin