ado@elsie.UUCP (Arthur David Olson) (09/15/84)
Challenge: 4bsd "lint" gives syntax error messages on correct programs.
Repeat by:
ed try.c
a
#include <stdio.h>
#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)