Wanted--better way to please lint and sccs

ado at elsie.UUCP ado at elsie.UUCP
Sun Mar 4 01:52:04 AEST 1984


Apologies if this is rehash...

One way to get "Source Code Control System*" strings into the object file for
"file.c" is to have it include a line like
	static char sccsid[] = "%A%";
However, if I include this line and fail to refer to sccsid, lint gripes.

I can get the SCCS information in (and keep lint happy) with a line like
	static sccsid() { if (!"%A%") sccsid(); }
which I think is pretty obscure.
(Briefly:  the call of sccsid avoids a lint "defined but never used" diagnostic;
"%A%" appears in an "if" expression to avoid a lint "null effect" diagnostic;
the '!' is there to avoid an infinite loop if "sccsid" is mistakenly called,
and to reduces the amount of code generated.)

What's a clearer or more concise way of doing this?
Use the 'r' command to reply to me by mail if you know.  Thanks.
--
* Unless "SCCS" is a trademark, I'm trademark free for once.
-- 
UUCP:	decvax!harpo!seismo!rlgvax!cvl!elsie!ado
DDD:	(301) 496-5688



More information about the Comp.lang.c mailing list