Re: [PATCH 06/16] bcache: Suppress more warnings about set-but-not-used variables
From: Coly Li <hidden>
Date: 2018-03-15 16:56:14
On 16/03/2018 12:50 AM, Bart Van Assche wrote:
On Fri, 2018-03-16 at 00:20 +0800, Coly Li wrote:quoted
On 15/03/2018 11:08 PM, Bart Van Assche wrote:quoted
This patch does not change any functionality. Signed-off-by: Bart Van Assche <redacted>Hi Bart, This patch looks good to me. A question is, does GCC later than 4.3 supports such annotation like '__maybe_unused' ?Hello Coly, You may want to have a look at the following commit: commit 0d7ebbbc6eaa5539f78ab20ed6ff1725a4e332ef Author: David Rientjes [off-list ref] Date: Wed May 9 02:35:27 2007 -0700 compiler: introduce __used and __maybe_unused __used is defined to be __attribute__((unused)) for all pre-3.3 gcc compilers to suppress warnings for unused functions because perhaps they are referenced only in inline assembly. It is defined to be __attribute__((used)) for gcc 3.3 and later so that the code is still emitted for such functions.
Hi Bart, Thanks for the hint, I don't need to worry about it. Reviewed-by: Coly Li <redacted> Coly Li