Why doesn't the GCC give any warning to these unused variables in the Linux kernel?
hizhisong at outlook.com
Sun Feb 20 02:39:13 EST 2022
Normally, the compiler warns if a variable is declared but is never referenced. In the Linux kernel source code, some unused functions and variables are marked __atrribute__((unused)).
GCC, on the other hand, does not provide any warnings for these unused and unmarked variables like the integer flags in kernel/sched/idle.c#427<https://elixir.bootlin.com/linux/latest/source/kernel/sched/idle.c#L427> .
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies