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 tree-optimization/39272] New: [4.4 Regression] -D_FORTIFY_SOURCE=2 no longer warns with new glibc headers


t.h:

#pragma GCC system_header

extern __inline __attribute__ ((__always_inline__)) char *
__attribute__ ((__nothrow__)) blabla (char *__restrict __dest, __const char
*__restrict __src)
{
  return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest,
2 > 1));
}

t.c:
#include "t.h"

char buf[6];
int main(int argc, char **argv) {
 blabla(buf,"hello ");
 return 0;
}


no longer warns with GCC 4.4 because blabla is in a system-header
(blabla == strcpy, but 4.3 folds that to memcpy which we also do not warn,
4.4 doesn't do that folding).


-- 
           Summary: [4.4 Regression] -D_FORTIFY_SOURCE=2 no longer warns
                    with new glibc headers
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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