Re: Why doesn't the GCC give any warning to these unused variables in the Linux kernel?

2022-02-20 Thread Greg KH
On Sun, Feb 20, 2022 at 07:39:13AM +, Song Zhi wrote: > 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)). > > > ==>

Why doesn't the GCC give any warning to these unused variables in the Linux kernel?

2022-02-19 Thread Song Zhi
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)). ==> https://livegrep.com/search/linux?q=__attribute__((unused)) GCC, on the other hand, does not provide