This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/8754: Allows illegal code
- From: pere at hungry dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 29 Nov 2002 13:43:08 -0000
- Subject: c/8754: Allows illegal code
- Reply-to: pere at hungry dot com
>Number: 8754
>Category: c
>Synopsis: Allows illegal code
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri Nov 29 05:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Petter Reinholdtsen
>Release: gcc-2.95.4
>Organization:
>Environment:
>Description:
The attached test code compiles using gcc, but
fail to compile on most other compilers. This is the error message on Irix:
cc-1065 cc: ERROR File = foo.c, Line = 3
A semicolon is expected at this point.
int main() { printf("foo\n"); return 1; }
^
1 error detected in the compilation of "foo.c".
I believe gcc should fail to compile this code as well.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug-gcc-double-main.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug-gcc-double-main.c"
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluKCkgewogIGludCBtYWluKCkgeyBwcmludGYoImZv
b1xuIik7IHJldHVybiAxOyB9CiAgOwogIHByaW50ZigiYmFyXG4iKTsKICByZXR1cm4gMDsKfQo=