'goto *foo' where foo is not a pointer. What is this?
问题 I was playing around with labels as values and ended up with this code. int foo = 0; goto *foo; My C/C++ experience tells me *foo means dereference foo and that this won't compile because foo isn't a pointer. But it does compile. What does this actually do? gcc (Ubuntu 4.9.2-0ubuntu1~12.04) 4.9.2 , if important. 回答1: This is a known bug in gcc. gcc has a documented extension that permits a statement of the form goto *ptr; where ptr can be any expression of type void* . As part of this