[cfe-commits] r69557 - in /cfe/trunk: test/Preprocessor/if_warning.c tools/clang-cc/Warnings.cpp

Chris Lattner sabre at nondot.org
Sun Apr 19 15:07:22 PDT 2009


Author: lattner
Date: Sun Apr 19 17:07:21 2009
New Revision: 69557

URL: http://llvm.org/viewvc/llvm-project?rev=69557&view=rev
Log:
Fix PR4007: clang doesn't know  -Werror-foo is the same as -Werror=foo

Modified:
    cfe/trunk/test/Preprocessor/if_warning.c
    cfe/trunk/tools/clang-cc/Warnings.cpp

Modified: cfe/trunk/test/Preprocessor/if_warning.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/if_warning.c?rev=69557&r1=69556&r2=69557&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/if_warning.c (original)
+++ cfe/trunk/test/Preprocessor/if_warning.c Sun Apr 19 17:07:21 2009
@@ -1,4 +1,5 @@
-// RUN: clang-cc %s -Eonly -Werror=undef -verify
+// RUN: clang-cc %s -Eonly -Werror=undef -verify &&
+// RUN: clang-cc %s -Eonly -Werror-undef -verify
 
 extern int x;
 

Modified: cfe/trunk/tools/clang-cc/Warnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Warnings.cpp?rev=69557&r1=69556&r2=69557&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/Warnings.cpp (original)
+++ cfe/trunk/tools/clang-cc/Warnings.cpp Sun Apr 19 17:07:21 2009
@@ -121,11 +121,12 @@
     }
     
     // -Werror/-Wno-error is a special case, not controlled by the option table.
-    // It also has the "specifier" form of -Werror=foo.
+    // It also has the "specifier" form of -Werror=foo and -Werror-foo.
     if (OptEnd-OptStart >= 5 && memcmp(OptStart, "error", 5) == 0) {
       const char *Specifier = 0;
       if (OptEnd-OptStart != 5) {  // Specifier must be present.
-        if (OptStart[5] != '=' || OptEnd-OptStart == 6) {
+        if ((OptStart[5] != '=' && OptStart[5] != '-') ||
+            OptEnd-OptStart == 6) {
           fprintf(stderr, "warning: unknown -Werror warning specifier: -W%s\n",
                   Opt.c_str());
           continue;





More information about the cfe-commits mailing list