Tag: gcc extensions

C代码中的开关大小写是“…”

这是/usr/src/linux-3.10.10-1-ARCH/include/linux/printk.h的一段代码: static inline int printk_get_level(const char *buffer) { if (buffer[0] == KERN_SOH_ASCII && buffer[1]) { switch (buffer[1]) { case '0' … '7': case 'd': /* KERN_DEFAULT */ return buffer[1]; } } } 这是一种运营商吗? 为什么“C程序devise语言”没有提到它?

C中是什么“ =”语法?

参考js0n.c 代码语法如下: static void *gostruct[] = { [0 … 255] = &&l_bad, ['\t'] = &&l_loop, [' '] = &&l_loop, ['\r'] = &&l_loop, ['\n'] = &&l_loop, ['"'] = &&l_qup, [':'] = &&l_loop, [','] = &&l_loop, ['['] = &&l_up, [']'] = &&l_down, // tracking [] and {} individually would allow fuller validation but is really messy ['{'] […]