Exploring GNU extensions in the Linux kernel
maskray.me
maskray.me
For example, Linux kernel use local labels, inline assembly and builtin functions heavily.
This article inspires me to persist studying in Linux kernel and Clang compiler.
make -s LLVM=1If anybody has an explanation for this I'd love to hear it.
Sony developers have proposed changes to improve the debugging experience and some work has been done, e.g. https://discourse.llvm.org/t/rfc-redefine-og-o1-and-add-a-ne...
* change representation to help make -g not change codegen : https://discourse.llvm.org/t/rfc-debuginfo-proposed-changes-...
Empty structures are useful, but behave weirdly. Structures containing a zero-size `char` array are much more portable.
Although `__builtin_choose_expr` isn't available in C++, it's trivial to implement using templates. Actually a lot of these are a reminder that GNU C exists for people who refuse to use C++ for political reasons.
`__builtin_types_compatible_p` is mostly not needed now that C11 `_Generic` exists.
static void tbl[] = {&&do_ret, &&do_inc, &&do_dec};
#define NEXT goto tbl[*pc++]
NEXT;
for(;;) {
do_ret: return val;
do_inc: val++; NEXT;
do_dec: val--; NEXT;
}