You think you have a reasonable grasp on C, then someone goes and writes:
[0x00 ... 0x17] = &&l_int
and you're like ???
(from https://github.com/quartzjer/cb0r/blob/master/src/cb0r.c)
You think you have a reasonable grasp on C, then someone goes and writes:
[0x00 ... 0x17] = &&l_int
and you're like ???
(from https://github.com/quartzjer/cb0r/blob/master/src/cb0r.c)
After looking at it a little longer, I think they're creating a jump table using labels, but yikes!
I have a list of C features that when I see them, I pretty much know that I need to find something else or re-write it from scratch. That code added a few new ones to my list.
That &&label; syntax is a gcc extension for computed labels thouhg. https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
:nods.
I think I've just been burned too many times by code that uses esoteric/advanced features when they were not needed.
So I tend to avoid them until I have learned how they work and when and where they should be used.
Playing with things I don't understand can lead me into dangerous places.