[1195] in Athena Bugs
RT6.0C: pcc/hc preprocessor breakage
daemon@ATHENA.MIT.EDU (Ken Raeburn)
Tue Oct 18 21:44:28 1988
Date: Tue, 18 Oct 88 21:44:06 EDT
From: Ken Raeburn <raeburn@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
1) hc requires the "-Hnocpp" argument to force it to use an
ANSI-conformant preprocessor; otherwise it uses /lib/cpp. It
also defines __STDC__==1, which implies that it is an
ANSI-conformant compiler implementation. It lies.
2) /lib/cpp, used by both pcc and hc, goes into an infinite loop with
the following input. It is valid ANSI C. It may or may not be
valid K&R C; either way, the compiler should not loop on it.
/*
* test of hc cpp
*/
int frob (x, y) int x, y; {
printf ("foo\n");
}
#define frob(x,y) ((x < y) ? 3 : (frob) (x, y))
void foo () {
frob (7, 3);
}