Community
Participate
Working Groups
GCC supports Labels as Values: http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Labels-as-Values.html#Labels-as-Values For this code: int main(void) { foo: puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ void* foo_p = &&foo; goto *foo_p; return EXIT_SUCCESS; } There are two syntax annotations - though the code builds an runs without error on Linux.
Or Alex's more realistic jumptable use case: int func(int i) { void *jumptable[4] = {&&lab0, &&lab1, &&lab2, &&lab3}; goto *jumptable[i]; lab0: return 0; lab1: return 1; lab2: return 2; lab3: return 3; return 4; }
Duplicate *** This bug has been marked as a duplicate of bug 84144 ***