Re: warning: calling â__builtin_return_addressâ with a nonzero argument is unsafe

From: Linus Torvalds
Date: Wed Jul 27 2016 - 23:22:04 EST


On Wed, Jul 27, 2016 at 6:58 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Wed, 27 Jul 2016 16:00:54 -0700
> Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> I can just add a
>>
>> KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
>
> I like this solution.

Ok. Pushed out. As long as people are aware of this, and are hopefully
at least looking for potential alternatives, it's fine.

I've squashed most of the warnings I see in my allmodconfig build.

The remaining ones are mostly objtool warnings (Josh added to cc: I
get both a "objtool: x86 instruction decoder differs from kernel"
warning, and several new "sibling call from callable instruction with
changed frame pointer" warnings).

There's also a couple of really annoying warnings from gcc:

drivers/sfi/sfi_core.c:175:53: warning: self-comparison always
evaluates to true [-Wtautological-compare]

which is a classic case of compiler people thinking that "comparing
things to itself is stupid", but it comes from using general-case
macros that then sometimes end up having simple uses where one part of
the comparison ends up being trivially true.

Since the "fix" (to avoid a generic macro helper and use special-case
simpler tests) is likely much worse than what the compiler actually
warns about, I suspect I will be just disabling that silly compiler
warning.

People who love being warned about tautological compares, speak up now
about your preferred alternative, or forever hold your peace. I do
*not* want to have stupid warnings show up by default, because then
people will just ignore the real ones when they pop up. That already
happens much too frequently.

Linus