Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site elsie.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!hao!seismo!umcp-cs!cvl!elsie!ado
From: ado@elsie.UUCP (Arthur David Olson)
Newsgroups: net.bugs.4bsd
Subject: 4.[12]bsd lint bug (really /lib/cpp bug) (reposting)
Message-ID: <1214@elsie.UUCP>
Date: Fri, 14-Sep-84 19:02:26 EDT
Article-I.D.: elsie.1214
Posted: Fri Sep 14 19:02:26 1984
Date-Received: Tue, 25-Sep-84 02:31:27 EDT
Organization: NIH-LEC, Bethesda, MD
Lines: 44

Challenge:	4bsd "lint" gives syntax error messages on correct programs.

Repeat by:
		ed try.c
		a
		#include 

		#define cputc	putchar	/* alias */

		main()
		{
			cputc('\n');
		}
		.
		w
		q
		cc try.c
		a.out
		lint try.c

		Note that the program compiles without error and runs correctly,
		but that lint produces these lines:
			try.c: 7: putchar: argument mismatch
			try.c(7): syntax error

Diagnosis:	What we REALLY have here is a "cpp" challenge.
		"lint" executes "cpp" with the "-C" flag so that comments are
		retained in the source code (this is designed to keep things
		like "/*ARGSUSED*/" from getting lost).  So "cpp" expands
			cputc('\n')
		into
			putchar/* alias */('\n')
		and then gets unhappy because there's no '(' immediately
		following "putchar".

What to do:	Await support of the "-C" option in the DECUS C preprocessor,
		then install that preprocessor on your machine.  And, whenever
		you send out code, send the DECUS C preprocessor along with it.
--
DECUS is almost surely a trademark of Digital Equipment Corporation,
or of the Digital Equipment Corporation Users' Society, or somebody.
--
	...decvax!seismo!umcp-cs!elsie!ado	(301) 496-5688
	(DEC, VAX and Elsie are Digital Equipment Corp. and Borden's trademarks)