Date: Tue, 4 Sep 2001 14:22:38 -0700 (PDT) From: Matt Dillon <dillon@earth.backplane.com> To: "David O'Brien" <obrien@FreeBSD.org> Cc: Kris Kennaway <kris@obsecurity.org>, "Andrey A. Chernov" <ache@nagual.pp.ru>, Mark Peek <mark@whistle.com>, 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) Message-ID: <200109042122.f84LMcm95136@earth.backplane.com> References: <200109041639.f84GdBm87501@freefall.freebsd.org> <20010904204454.A32114@nagual.pp.ru> <p05100307b7bab7186d08@[10.1.10.118]> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
How about this: blah.c: #include <rcsid.h> ... __RCSID("$FreeBSD$"); (where CVS will expand the $FreeBSD$ part when a file is checked in). And we create a new header file, <rcsid.h>, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109042122.f84LMcm95136>