From owner-cvs-all Tue Sep 4 14:32: 4 2001 Delivered-To: cvs-all@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id A28C237B408; Tue, 4 Sep 2001 14:31:54 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f84LVsM39255; Tue, 4 Sep 2001 14:31:54 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 2A652390B; Tue, 4 Sep 2001 14:31:54 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Matt Dillon Cc: "David O'Brien" , Kris Kennaway , "Andrey A. Chernov" , Mark Peek , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: macro recommendation (Was Re: cvs commit: src/lib/libc/stdlib strtol.3 strtol.c strtoll.c strtoq.c strtoul.3 strtoul.c strtoull.c strtouq.c) In-Reply-To: <200109042122.f84LMcm95136@earth.backplane.com> Date: Tue, 04 Sep 2001 14:31:54 -0700 From: Peter Wemm Message-Id: <20010904213154.2A652390B@overcee.netplex.com.au> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matt Dillon wrote: > How about this: > > blah.c: > > #include > > ... > > __RCSID("$FreeBSD$"); > > (where CVS will expand the $FreeBSD$ part when a file is checked in). Uhh. why not this: #include __RCSID("$FreeBSD$); After all, we already *have* it. And as a bonus it works on NetBSD and OpenBSD too. peter@daintree[2:30pm]~-135> cat c.c #include __RCSID("$FreeBSD: Foo 1.1 $"); peter@daintree[2:30pm]~-136> cc -ansi -pedantic -c c.c peter@daintree[2:30pm]~-137> ident c.o c.o: $FreeBSD: Foo 1.1 $ > And we create a new header file, , to hold the macro? I looked > at a bunch of libc and there is no single pre-existing header file that > they all #include. This is a simple, short, and straightforward way of > doing it. > > The macro will simply generate the static const rcsid[] array as a > default. I'll add a make.conf option to allow people to have the > macro turn into a nop. > > If people agree, I'd be happy to commit the rcsid.h file and start > working on library code (hopefully a bunch of people would work on > the library code in parallel!). With two or three people working on > it we could have everything instrumented in -current in a few days, > and MFC it to -stable after the release (it should be easy to patch). > > We could also standardize older identifiers... for example, we could > turn the SCCSID stuff from: > > #if defined(LIBC_SCCS) && !defined(lint) > static char sccsid[] = "@(#)lseek.c 8.1 (Berkeley) 6/17/93"; > #endif /* LIBC_SCCS and not lint */ > > To: > > __SCCSID("@(#)lseek.c 8.1 (Berkeley) 6/17/93"); > > And other embedded id's would work the same. __NETBSDID, __OPENBSDID, > etc... All very simple macros. > > -Matt > > > Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message