http://llvm.org/bugs/show_bug.cgi?id=9977

           Summary: clang should warn on memset(s, 0, sizeof(s)) – needs
                    to be sizeof(*s)
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


#include <memory.h>

struct S {
  char a;
};

void f(S* s) {
  memset(s, 0, sizeof(s));
}


clang should warn that the memset call is missing a dereference for s. This is
a common error and easy to catch.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to