Y
Hacker News
new
|
ask
|
show
|
jobs
by
pontifk8r
1814 days ago
Computed GOTOs in C are just pointer arithmetic and casts.
1 comments
whatshisface
1814 days ago
Can you jump to a computed GOTO in C? I guess you can if you cast to a function pointer...
link
wk_end
1813 days ago
I’m no C language lawyer, but it’s hard to imagine that sort of voodoo won’t trigger some kind of undefined behaviour that’ll cause the optimizer to erase your program at best and summon nasal demons at worst.
link
floxy
1813 days ago
https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
link
comex
1813 days ago
Yes, but it’s a GCC extension, not standard.
link