Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c.c is invalid #60

Open
intosi opened this issue Jul 11, 2016 · 4 comments
Open

c.c is invalid #60

intosi opened this issue Jul 11, 2016 · 4 comments

Comments

@intosi
Copy link

intosi commented Jul 11, 2016

Exporting an int as 'main' is not a legal C program. This will crash with a bus error on OS X, SEGV on Debian 8 and FreeBSD 10.

@mathiasbynens
Copy link
Owner

Did you see #39? CC @Matheus28

@intosi
Copy link
Author

intosi commented Jul 13, 2016

Fair enough, but then the following C file is equally valid, as you may apparently ignore warnings, and int is implicit if no type is specified:

main;

@catsmells
Copy link

Exporting an int as 'main' is not a legal C program. This will crash with a bus error on OS X, SEGV on Debian 8 and FreeBSD 10.

yeah but it works

@angleKH
Copy link

angleKH commented Nov 9, 2021

Fair enough, but then the following C file is equally valid, as you may apparently ignore warnings, and int is implicit if no type is specified:

main;

The so-called implicit int rule doesn't exist anywhere in the current C standards, and came from a time before C was standardized, so just using main; would be invalid. However, I agree that the current int main; is also problematic, so you might be interested in #87.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants