I've found this kind of code which is accepted by Clang and GCC, but not by lang-c.
int fn() {
int ifn() {
return 5;
}
return ifn();
}
fn is a function having an internal function, named ifn. ifn is only in scope inside the body of fn. This is not standard C, but a GNU extension. I don't think it's in ANSI C or ISO C99, or K&R, or anything like that. So I am not sure if we want or need to accept this kind of code in lang-c.
Sure, it would be nice to add support for this extension. GNU extensions are definitely in the scope for lang-c, there is already support for a small number of them.
I've found this kind of code which is accepted by Clang and GCC, but not by lang-c.
fn
is a function having an internal function, namedifn
.ifn
is only in scope inside the body offn
. This is not standard C, but a GNU extension. I don't think it's in ANSI C or ISO C99, or K&R, or anything like that. So I am not sure if we want or need to accept this kind of code in lang-c.I'm getting this error message:
What do you think?