All of lore.kernel.org
 help / color / mirror / Atom feed
* warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe
@ 2016-07-27 23:00 Linus Torvalds
  2016-07-28  1:58 ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2016-07-27 23:00 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Linux Kernel Mailing List

So almost all of our __builtin_return_address() users use a zero
argument, but we have a couple in-tree. They all seem to be related to
tracing:

  kernel/trace/trace_irqsoff.c
  kernel/trace/trace_sched_wakeup.c

and it causes a fair number of lines of warning noise on current
kernels with at least gcc-6.1.1. See

    https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

that says

   "-Wframe-address:
        Warn when the ‘__builtin_frame_address’ or
‘__builtin_return_address’ is called with an argument greater than 0.
Such calls may return indeterminate values or crash the program. The
warning is included in -Wall"

I can just add a

  KBUILD_CFLAGS  += $(call cc-disable-warning,frame-address,)

in the main Makefile, and that is indeed what I have in my tree right
now and will likely commit soon. The warning isn't actually helpful
for us, and there doesn't seem to be any other way to turn it off. At
the same time, there is a somewhat valid reason for that warning
existing, so I'm wondering if the tracing code could perhaps try to
change.

I detest having lots of warnings when doing my test builds, because
the uninteresting warnings often hide real ones that might actually
matter.

Comments?

             Linus

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-01 18:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-27 23:00 warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe Linus Torvalds
2016-07-28  1:58 ` Steven Rostedt
2016-07-28  3:21   ` Linus Torvalds
2016-07-28  3:52     ` Steven Rostedt
2016-07-29  1:25       ` Linus Torvalds
2016-07-29  2:30         ` Steven Rostedt
2016-08-01 18:10           ` Steven Rostedt
2016-08-01 18:19             ` Linus Torvalds
2016-07-28 12:42     ` Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.