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

Failure to error on redefinition of variable as function #43

Open
GabrielRavier opened this issue Oct 23, 2021 · 0 comments
Open

Failure to error on redefinition of variable as function #43

GabrielRavier opened this issue Oct 23, 2021 · 0 comments

Comments

@GabrielRavier
Copy link

GabrielRavier commented Oct 23, 2021

int foo;
void foo();

On GCC, this gives:

test.c:2:6: error: ‘foo’ redeclared as different kind of symbol
    2 | void foo() {}
      |      ^~~
test.c:1:5: note: previous declaration of ‘foo’ with type ‘int’
    1 | int foo;
      |     ^~~

cwj compiles the file without an error when it probably should error (it already errors if, say, the second declaration is char foo;, so it seems easy to do this with a function redefinition too)

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

1 participant