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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2016-06-02
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot 
gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.3, 5.3.0, 6.1.0, 7.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The root cause of this is that the built-ins are declared without the non-null
attribute (analogous to, for example, __builtin_strlen).  With the attribute
added, GCC issues a warning when it sees an invocation of one like the one in
comment #0:

zzz.cpp:3:67: warning: null argument where non-null required (argument 3)
[-Wnonnull]
   __builtin_printf ("%i\n", __builtin_sadd_overflow (1, 2, (int*)0));
                                                                   ^

Since I'm working in this area let me put together a complete patch.

Reply via email to