https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106080

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #7)
> I know you can't jump into a statement expression but that's not what's
> happening here.  The kernel uses this trick to get the current address for
> error messages:
> 
> #define __this_address ({ __label__ __here; __here: barrier(); &&__here; })
> 
> and they will have to disable the warning completely because of it.  The
> manual for -Wdangling-pointer also talks about pointers to *objects* and
> labels aren't objects.

But that is undefined at what label or even where label would be located; it
could be located anywhere. The kernel use of this extension should be removed
as it is not using it to get an useful value at all. Maybe we should add
another builtin to get the current PC.

Also can't they turn off the warning inside the statement expression/around the
macro?

Reply via email to