Skip to content

chibicc accepts invalid code #164

@aalmkainzi

Description

@aalmkainzi

Hi. I've been working on a fork of chibicc to implement my own ideas.
I noticed that chibicc accepts invalid code in many cases.

For example this code:

struct A
{
    struct { char b; } aa;
};

struct A
{
    float ff;
};

int foo(int i)
{
    return i;
}

int main()
{
    struct A a = 50;
    char *a = 100;
    return foo(a);
}

Something that should have been rejected:

  • redefinition of struct
  • assigning a struct variable with the wrong type
  • assigning a char* variable with the wrong type
  • re-declaring local variable with same name.
  • calling a foo with char* when it takes int

I can try to make PRs for some of these, but I'm worried this project is abandoned and doesn't accept PRs anymore.

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