Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is absolutely beautiful. I didn't know you could get an address of a label in C or to do a goto to an address from variable instead of a literal label. Is this new in C, or was it always there?



Is there an equivalent for Clang/LLVM?


Yes.

http://blog.llvm.org/2010/01/address-of-label-and-indirect-b...

A venerable interpreter implementation trick.


Unfortunately it won't port to IAR, which is a shame. I don't understand why pointers to labels never made it to the C spec; it's one of the (equivaling) features that actually makes assembler look elegant.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: