Skip to content

Failure to error on redefinition of variable as function #43

Open
@GabrielRavier

Description

@GabrielRavier
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions