From owner-cvs-all Tue Sep 4 14:22:47 2001 Delivered-To: cvs-all@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id CA11F37B403; Tue, 4 Sep 2001 14:22:38 -0700 (PDT) Received: (from dillon@localhost) by earth.backplane.com (8.11.6/8.11.2) id f84LMcm95136; Tue, 4 Sep 2001 14:22:38 -0700 (PDT) (envelope-from dillon) Date: Tue, 4 Sep 2001 14:22:38 -0700 (PDT) From: Matt Dillon Message-Id: <200109042122.f84LMcm95136@earth.backplane.com> To: "David O'Brien" Cc: Kris Kennaway , "Andrey A. Chernov" , Mark Peek , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: 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) References: <200109041639.f84GdBm87501@freefall.freebsd.org> <20010904204454.A32114@nagual.pp.ru> <200109041705.f84H5W692572@earth.backplane.com> <20010904122843.A56085@xor.obsecurity.org> <20010904233320.A34429@nagual.pp.ru> <20010904123718.A56317@xor.obsecurity.org> <20010904234757.A34576@nagual.pp.ru> <20010904125125.A56758@xor.obsecurity.org> <20010904140449.B75606@dragon.nuxi.com> 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 How about this: blah.c: #include ... __RCSID("$FreeBSD$"); (where CVS will expand the $FreeBSD$ part when a file is checked in). 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message