From: Douglas Gregor Date: Fri, 6 Nov 2009 05:24:12 +0000 (+0000) Subject: Turn off -Wsign-compare warnings by default X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35de813674503b87ec5117b6492cc0a4ef7d8728;p=clang Turn off -Wsign-compare warnings by default git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86233 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 8cfdd40950..2a998d17c6 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -70,7 +70,7 @@ def ReturnType : DiagGroup<"return-type">; def : DiagGroup<"sequence-point">; def : DiagGroup<"shadow">; def : DiagGroup<"shorten-64-to-32">; -def : DiagGroup<"sign-compare">; +def SignCompare : DiagGroup<"sign-compare">; // Preprocessor warnings. def : DiagGroup<"builtin-macro-redefined">; @@ -129,6 +129,7 @@ def Format2 : DiagGroup<"format=2", def Extra : DiagGroup<"extra", [ + SignCompare, UnusedParameter ]>; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index e825e6e826..729395a32a 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1542,10 +1542,10 @@ def err_stmtexpr_file_scope : Error< "statement expression not allowed at file scope">; def warn_mixed_sign_comparison : Warning< "comparison of integers of different signs: %0 and %1">, - InGroup>; + InGroup>, DefaultIgnore; def warn_mixed_sign_conditional : Warning< "operands of ? are integers of different signs: %0 and %1">, - InGroup>; + InGroup>, DefaultIgnore; def err_invalid_this_use : Error< "invalid use of 'this' outside of a nonstatic member function">; diff --git a/test/Sema/compare.c b/test/Sema/compare.c index 9cbbfba935..45a100be1e 100644 --- a/test/Sema/compare.c +++ b/test/Sema/compare.c @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: clang-cc -fsyntax-only -pedantic -verify -Wsign-compare %s int test(char *C) { // nothing here should warn. return C != ((void*)0); diff --git a/test/Sema/conditional-expr.c b/test/Sema/conditional-expr.c index 3bfeae5d4c..8cac32c82f 100644 --- a/test/Sema/conditional-expr.c +++ b/test/Sema/conditional-expr.c @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -pedantic %s +// RUN: clang-cc -fsyntax-only -verify -pedantic -Wsign-compare %s void foo() { *(0 ? (double *)0 : (void *)0) = 0; // FIXME: GCC doesn't consider the the following two statements to be errors. diff --git a/test/SemaCXX/compare.cpp b/test/SemaCXX/compare.cpp index 806b078e8d..2a2963493b 100644 --- a/test/SemaCXX/compare.cpp +++ b/test/SemaCXX/compare.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: clang-cc -fsyntax-only -pedantic -verify -Wsign-compare %s int test0(long a, unsigned long b) { enum Enum {B}; diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index da2dd67d06..f76472bf2f 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -faccess-control -std=c++0x %s +// RUN: clang-cc -fsyntax-only -verify -faccess-control -std=c++0x -Wsign-compare %s // C++ rules for ?: are a lot stricter than C rules, and have to take into // account more conversion options. diff --git a/utils/C++Tests/LLVM-Syntax/lit.local.cfg b/utils/C++Tests/LLVM-Syntax/lit.local.cfg index 5c19c4df16..90c6f33665 100644 --- a/utils/C++Tests/LLVM-Syntax/lit.local.cfg +++ b/utils/C++Tests/LLVM-Syntax/lit.local.cfg @@ -12,7 +12,7 @@ root = getRoot(config) # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.SyntaxCheckTest(compiler=root.clang, dir='%s/include/llvm' % root.llvm_src_root, - recursive=True, + recursive=False, pattern='^(.*\\.h|[^.]*)$', excludes=['DAGISelHeader.h', 'AIXDataTypesFix.h',