#164·chibicc

chibicc accepts invalid code

Author: aalmkainziCreated Feb 19, 2026Updated Feb 20, 2026

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:

c
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.