Skip to content
Prev 39363 / 63424 Next

Does R use "computed gotos" - a gcc extension of C?

On 03/ 4/11 11:40 PM, luke-tierney at uiowa.edu wrote:
Thank you Luke. Do you know if there may be any others?

Do you know if that bit of code gets compiled into all 3 of the R libraries? I 
tried replacing


#define NEXT() (__extension__ ({goto *(*pc++).v;}))


by a function which did absolutely nothing. The code built, but still had the 
library issues.

I'm almost certain that the definition of NEXT will cause problems, but I'm not 
convinced it is the only issue.

What happens if a non-GNU compiler is used? I assume these GNU extensions don't 
get used, so how comes the code builds? Is there any way I can disable the use 
of the GNU extensions, while still building with gcc.

It is rather annoying that the code has __extension__ in it, which disables the 
warnings about the use of GCC extensions.

http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

Why is there a need to hide the use of the extensions? I'd personally like to 
see just standard C used, without any extensions. Then problems like I'm having 
would be less likely to occur.