Path: utzoo!attcan!uunet!husc6!necntc!ima!haddock!karl
From: karl@haddock.ISC.COM (Karl Heuer)
Newsgroups: comp.lang.c
Subject: Re: C Compiler bugs (was Re: Speaking of ksh)
Message-ID: <4497@haddock.ISC.COM>
Date: 10 Jun 88 16:52:54 GMT
References: <15085@tut.cis.ohio-state.edu> <4421@haddock.ISC.COM> <532@wrs.UUCP>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 19

(Since the question was directed toward me, I'll take the liberty of replying
in public and hope that nobody else does so.)

In article <532@wrs.UUCP> owen@wrs.UUCP (Owen DeLong) writes:
>Tell me, Karl, where do you see the bug causing the program to dump core?
>
>I get the impression that the bug is in the compiler, and the compiler which
>doesn't need a ; (noted as missing) dumped core upon trying to return from
>function main.  I see this as definitely being a compiler bug, particularly
>if you consider the code to be correct.  It is conceivable to call the code
>incorrect (syntax error due to missing semicolon), ...

The point is that there is NO SYNTAX ERROR in the program.  The code fragment
  struct foo {...} main() {...}
is a perfectly valid declaration of a function named "main" whose return type
is "struct foo {...}".  It happens not to be what the user intended, but it's
still syntactically correct.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint