[Bug c/95625] missing detail in -Waddress initializing a function argument

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 15 16:45:48 GMT 2020


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |c

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
As mentioned in comment #0, this is a generic C/C++ improvement: "The test case
is C++ but a similar improvement applies to the C front end."  In fact, it's
even more relevant to C where the warning doesn't underline the argument it
refers to:

Here's a corresponding C test case.  Wh

$ cat pr95625.c && gcc -O2 -S -Wall -Wextra pr95625.c
void f (int, int, int, _Bool, int *);

void g (int i)
{
  f (1, 2, 3, &i, &i);
}
pr95625.c: In function ‘g’:
pr95625.c:5:3: warning: the address of ‘i’ will always evaluate as ‘true’
[-Waddress]
    5 |   f (1, 2, 3, &i, &i);
      |   ^


More information about the Gcc-bugs mailing list