Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site edai.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!vax135!ukc!edcaad!edee!edai!ok From: ok@edai.UUCP Newsgroups: net.lang.c Subject: Why does lint foul up on #if 0 Message-ID: <3942@edai.UUCP> Date: Thu, 19-Jan-84 08:23:30 EST Article-I.D.: edai.3942 Posted: Thu Jan 19 08:23:30 1984 Date-Received: Fri, 27-Jan-84 04:37:50 EST Organization: Art.Intelligence,Edin.Univ. Lines: 32 I like putting great big block comments in my C programs. I like putting examples of how to use various things in those comments. And of course well-written examples are commented. So the scheme I use is #if 0 /* COMMENT */ ... lots of text ... ... bits of C code, which can safely use /* comments */ ... lots of text ... #endif 0 /* COMMENT */ The two lines starting with a sharp are precisely what I type. Now I have used 6 different C compilers on 4 different kinds of machines, and all but the version 6+ PDP-11 C pre-processor were quite happy with it. In v6+ I had to say #ifdef COMMENT and be very very careful never to define COMMENT. As a careful programmer, I would like to use "lint". BUT lint evidently thinks 0 is true, and TRIES TO COMPILE MY COMMENTS!!!! I have put together an interface to lint that shoves all the files through the preprocessor (courtesy of "cc -E"), but it tends to tie up file space and from time to time I forget to use it. Can anyone tell me (a) why "lint" does something so very different from /lib/cpp with #if 0 (b) whether there is an easy way to tell it not to (c) whether System III/System V "lint" is this stupid (there must be *some* reason why people get S3 instead of 4.1).