The Linux kernel is written in C, but it also leverages extensionsprovided by GCC. In 2022, it moved from GCC/Clang-std=gnu89to-std=gnu11. This articleexplores my notes on how these GNU extensions are utilized within thekernel.Statement expressionsStatementexpressionsare commonly used in macros.LocallabelsSome macros use this extension to restart a for loop in a macro'sreplacement list.123456789101112131415161718192021222324// include/linux/wait.h#define___wait_event(wq_head, condition, state, exclusive, ret, cmd) \({
...
继续阅读
(4)