Support for labels as values (GNU extension)
GNU C / Clang support an extension where the address of a label can be taken as a value and assigned to a variable, and then jumped to using goto.
https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
For example, this small test program:
int main(void)
{
int r;
foo:
r = 4;
void *f = &&foo;
goto *f;
return 0;
}
causes the following errors from FlexeLint:
--- Module: main.c (C)
_
void *f = &&foo;
main.c 8 Error 24: Expected an expression, found '&&'
main.c 8 Error 40: Undeclared identifier 'foo'
_
goto *f;
main.c 11 Error 10: Expecting identifier
Is there some combination of flags that can be used to check code using this extension, or does lint support it somehow?
![](https://secure.gravatar.com/avatar/e48f66421ecdc7509b7670cf17bff2e5?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
This extension is supported in the upcoming PC-lint Plus.