Way OT programming question

Jerry McAllister jerrymc at clunix.cl.msu.edu
Mon Aug 2 07:49:05 PDT 2004


> 
> I've been muddling through some of the source files for FreeBSD 
> 5.2.1-RELEASE, and I've noticed that a large number of .c files 
> in /usr/src have something similar to below in them:
> 
> #ifndef lint
> #if 0
> static char sccsid[] = "@(#)cat.c       8.2 (Berkeley) 4/27/95";
> #endif
> #endif /* not lint */
> #include <sys/cdefs.h>
> __FBSDID("$FreeBSD: src/bin/cat/cat.c,v 1.29 2003/04/30 17:40:28 
> obrien Exp $");
> 
> 1) Isn't 'if 0' always negative?

In a boolean usage like above, yes.   Anyway, FALSE usually gets
defined to be 0.   So, the above piece of code is disabled - sort
of commented out, so to speak.

> 2) What is the __FBSDID line doing?

Looks like it sets or checks some version information.  Guess I could 
look it up, but then, so could you.

////jerry

> 
> -- 
> Thanks,
> 
> Josh Paetzel
> _______________________________________________


More information about the freebsd-questions mailing list