ken@CS.ROCHESTER.EDU (Ken Yap) (01/24/89)
Is this a legal program? SunOS 3.4 cc thinks so. gcc 1.31 doesn't.
typedef int DVIU;
foo()
{
struct dvi_file_stack {
DVIU s_h, s_v, s_hh, s_vv, s_w, s_x, s_y, s_z};
}
Session:
gcc version 1.31
/usr/su/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__HAVE_68881__ -Dmc68020 b.c /tmp/cca26908.cpp
GNU CPP version 1.31
/usr/su/lib/gcc-cc1 /tmp/cca26908.cpp -quiet -dumpbase b.c -version -o /tmp/cca26908.s
GNU C version 1.31 (68k, MIT syntax) compiled by GNU C version 1.31.
b.c: In function foo:
b.c:6: parse error before `}'
ken@CS.ROCHESTER.EDU (Ken Yap) (01/24/89)
Sorry, ignore that last message. Stop sending me mail. It is in fact not legal C. It is missing a semicolon before the }. I do know about C syntax, but the combination of somebody elses indentation style, an overpermissive Sun cc and the late hour caused me to miss the error. What annoys me is that lint wouldn't have caught the error either because it is based on the same pcc parser. Maybe I should start using gcc as a checker (1/2 (-:).