[cfe-commits] r130538 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/SemaCXX/warn-non-pod-memset.cpp

Chandler Carruth chandlerc at gmail.com
Fri Apr 29 13:58:14 PDT 2011


Author: chandlerc
Date: Fri Apr 29 15:58:14 2011
New Revision: 130538

URL: http://llvm.org/viewvc/llvm-project?rev=130538&view=rev
Log:
Disable -Wnon-pod-memset for now while I try to reduce the false
positives still further.

The plan is to:

1) Create a more targeted warning for memset of memory pointing at
   a type with virtual methods or bases where a vptr would be
   overwritten.
2) Consider turning the above warning back on by default.
3) Evaluate whether any false positives in the existing warning can be
   detected and white listed in the warning implementation.
4) If #3 lowers the noise floor enough, enable the full warning in -Wall
   or -Wextra.

Comments or suggestions welcome. Even more welcome are specific test
cases which trigger the warning and shouldn't.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/SemaCXX/warn-non-pod-memset.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=130538&r1=130537&r2=130538&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Apr 29 15:58:14 2011
@@ -263,7 +263,7 @@
 def warn_builtin_unknown : Warning<"use of unknown builtin %0">, DefaultError;
 def warn_non_pod_memset : Warning<
   "destination for this memset call is a pointer to a non-POD type %0">,
-  InGroup<DiagGroup<"non-pod-memset">>;
+  InGroup<DiagGroup<"non-pod-memset">>, DefaultIgnore;
 def note_non_pod_memset_silence : Note<
   "explicitly cast the pointer to silence this warning">;
 

Modified: cfe/trunk/test/SemaCXX/warn-non-pod-memset.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-non-pod-memset.cpp?rev=130538&r1=130537&r2=130538&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-non-pod-memset.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-non-pod-memset.cpp Fri Apr 29 15:58:14 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wnon-pod-memset -verify %s
 
 extern void *memset(void *, int, unsigned);
 





More information about the cfe-commits mailing list