3 ms·
I would not have thought that return ({goto L; 0;}) && ({L: 5;}); was valid C. GCC 4.4.7 chokes on it, using -std=gnu99. Is this a C11 thing?
by rootbear 13y ago
I would not have thought that
return ({goto L; 0;}) && ({L: 5;});
was valid C. GCC 4.4.7 chokes on it, using -std=gnu99. Is this a C11 thing?
- DerekL 13y agoNo, it's a GCC extension. That entire section is about non-standard GCC features.
- apaprocki 13y agoTo the compiler, it shouldn't care where a label exists. If you're telling it to go to label L:, execution will jump there. GCC appears to look out for the programmer and always prints an error (and I don't see an option to shut it off). Oracle Studio compiles it with no issue and the above statement returns 1.
- mikestew 13y agoI just slapped it into Xcode and compiled using LLVM 4.2 (-std=gnu99), and it works fine. Using Xcode's LLVM GCC 4.2 setting (-std=gnu99 by default), it chokes. Conclusion: I kind of lost interest at this point. :-) I don't quickly know how to get it to compile using GCC, though.