[Bug c/78989] New: Missing -Waddress warning

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 4 17:27:00 GMT 2017


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

            Bug ID: 78989
           Summary: Missing -Waddress warning
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Following test-case does not report warning:

$ cat /tmp/gimplify.ii 
int 
asan_poison_variables ()
{
 return (asan_poison_variables &&  
# 6 "gimplify.cpp" 3 4
                              __null
                                  );
}

./xgcc -B. /tmp/gimplify.ii -Wall -c
[nothing]

While:

cat /tmp/gimplify.ii 
int 
asan_poison_variables ()
{
 return (asan_poison_variables &&  
                              __null
                                  );
}
$ ./xgcc -B. /tmp/gimplify.ii -Wall -c
/tmp/gimplify.ii: In function ‘int asan_poison_variables()’:
/tmp/gimplify.ii:5:31: warning: the address of ‘int asan_poison_variables()’
will never be NULL [-Waddress]
                               __null
                               ^~~~~~

It's somehow related to the location if *.ii file, but I don't know how.
Thanks


More information about the Gcc-bugs mailing list