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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org
         Depends on|                            |43486

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Variable-uses don't have locations in GCC (yet, hopefully some day when the FEs
get replaced by Clang), so the warning points to "print_it", which is inside
the macro. Then, warn_uninit does:

  location = linemap_resolve_location (line_table, location,
                                       LRK_SPELLING_LOCATION, NULL);

which means that the location points at the spelling location, that is, inside
the macro.

This has nothing to do with headers. A simpler testcase is: 

void bar(int);
#define foo(x) bar(x)
void test(void)
{
  int uninit;
  foo(uninit);
}


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43486
[Bug 43486] Preserve variable-use locations

Reply via email to