This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/40340] New: [4.4/4.5 Regression] Fortification warning no longer emitted in inlines


w.h:
#pragma GCC system_header
typedef __SIZE_TYPE__ size_t;
extern void *memset (void *__s, int __c, size_t __n)
  __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__))
__attribute__ ((__artificial__))
void *
__attribute__ ((__nothrow__))
memset (void *__dest, int __ch, size_t __len)
{
  return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size
(__dest, 0));
}
w.c:
#include "w.h"

static inline void
test (char *p)
{
  memset (p, 0, 6);
}

int
main (void)
{
  char buf[4];
  test (buf);
  memset (buf, 0, 6);
  return 0;
}

gcc 4.3 used to emit 2 warnings, gcc 4.4 and trunk only one (but both 4.3 and
4.4+ emit two __memset_chk calls that will always __chk_fail at runtime).


-- 
           Summary: [4.4/4.5 Regression] Fortification warning no longer
                    emitted in inlines
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40340


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]