tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RCSID/SCCS conditionals



Hi all,
a lot of the older NetBSD source files start with 

#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)abort.c     8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: abort.c,v 1.12 2003/08/07 16:43:37 agc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

for libc and without the defined(LIBC_SCCS) conditional for normal
sources.

I think this is a lot of redundant noise and before copying it yet again
to different places, I'd like to be able to clean this up for the
involved sources.

First of all, the !defined(lint) is redundant, our lint understands
__RCSID enough to ignore it.

The define for sccsid should either just go away (I don't think it
provides value) or use __SCCSID. In the latter case it might be a good
idea to change __SCCSID to __asm__("") to silence lint.

The defined(LIBC_SCCS) in libc can go away as well, the same
functionality can be obtained with objcopy -R .ident and can be
documented as such. If there is enough interest in it, it could even be
integrated into the library build.

There is one downside -- SYSLIBC_SCCS can't be stripped off at least on
amd64. I'm not sure changes that to use the .ident section as well
creates problems for anything.

With the above suggestions, it would become:
#include <sys/cdefs.h>
__SCCSID("@(#)abort.c     8.1 (Berkeley) 6/4/93");
__RCSID("$NetBSD: abort.c,v 1.12 2003/08/07 16:43:37 agc Exp $");

or just
#include <sys/cdefs.h>
__RCSID("$NetBSD: abort.c,v 1.12 2003/08/07 16:43:37 agc Exp $");

Joerg


Home | Main Index | Thread Index | Old Index