c.opt (Waddress): New.
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Mon, 19 Feb 2007 20:02:28 +0000 (20:02 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Mon, 19 Feb 2007 20:02:28 +0000 (20:02 +0000)
2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

* c.opt (Waddress): New.
* common.opt (Walways-true): Delete.
(Wstring-literal-comparison): Delete.
* doc/invoke.texi (Warning Options): Delete -Walways-true and
-Wstring-literal-comparison. Add -Waddress.
(Waddress): New.
(Walways-true): Delete.
(Wstring-literal-comparison): Delete.
* doc/extend.texi (#pragma GCC diagnostic): Use -Wformat
consistently instead of -Walways-true in example.
* c-opts.c (c_common_handle_option): -Waddress is enabled by -Wall.
* c-typeck.c (parser_build_binary_op): Replace
-Wstring-literal-comparison and -Walways-true with -Waddress.
* c-common.c (c_common_truthvalue_conversion): Replace -Walways-true
with -Waddress.

cp/
* typeck.c (build_binary_op): Replace -Wstring-literal-comparison
and -Walways-true with -Waddress.
* cvt.c (convert_to_void): Replace unconditional warning with
-Waddress.

testsuite/
* gcc.dg/20031012-1.c: Replace -Walways-true with -Waddress.
* gcc.dg/Walways-true-1.c: Likewise.
* gcc.dg/weak/weak-3.c: Likewise.
* gcc.dg/Werror-1.c: Likewise.
* gcc.dg/Werror-3.c: Likewise.
* gcc.dg/Werror-4.c: Likewise.
* gcc.dg/Werror-5.c: Likewise.
* gcc.dg/Werror-6.c: Likewise.
* gcc.dg/Werror-7.c: Likewise.
* gcc.dg/Werror-8.c: Likewise.
* gcc.dg/Werror-10.c: Likewise.
* gcc.dg/Werror-11.c: Likewise.
* gcc.dg/Werror-12.c: Likewise.
* g++.old-deja/g++.mike/warn8.C: Likewise.
* g++.dg/warn/Walways-true-1.C: Likewise.
* g++.dg/warn/Walways-true-2.C: Likewise.
* g++.dg/warn/noeffect8.C: Warn only with -Waddress.
* g++.dg/warn/Wstring-literal-comparison-1.C: Replace
-Wstring-literal-comparison with -Waddress.
* gcc.dg/Wstring-literal-comparison-4.c: Replace
-Wno-string-literal-comparison with -Wno-address.

From-SVN: r122136

36 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-opts.c
gcc/c-typeck.c
gcc/c.opt
gcc/common.opt
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/cp/typeck.c
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Walways-true-1.C
gcc/testsuite/g++.dg/warn/Walways-true-2.C
gcc/testsuite/g++.dg/warn/Wstring-literal-comparison-1.C
gcc/testsuite/g++.dg/warn/Wstring-literal-comparison-4.C
gcc/testsuite/g++.dg/warn/noeffect8.C
gcc/testsuite/g++.old-deja/g++.mike/warn8.C
gcc/testsuite/gcc.dg/20031012-1.c
gcc/testsuite/gcc.dg/Walways-true-1.c
gcc/testsuite/gcc.dg/Walways-true-2.c
gcc/testsuite/gcc.dg/Werror-1.c
gcc/testsuite/gcc.dg/Werror-10.c
gcc/testsuite/gcc.dg/Werror-11.c
gcc/testsuite/gcc.dg/Werror-12.c
gcc/testsuite/gcc.dg/Werror-3.c
gcc/testsuite/gcc.dg/Werror-4.c
gcc/testsuite/gcc.dg/Werror-5.c
gcc/testsuite/gcc.dg/Werror-6.c
gcc/testsuite/gcc.dg/Werror-7.c
gcc/testsuite/gcc.dg/Werror-8.c
gcc/testsuite/gcc.dg/Werror-9.c
gcc/testsuite/gcc.dg/Wstring-literal-comparison-1.c
gcc/testsuite/gcc.dg/Wstring-literal-comparison-4.c
gcc/testsuite/gcc.dg/warn-addr-cmp.c
gcc/testsuite/gcc.dg/weak/weak-3.c

index f52131442161ab2e75d30396d81f2058a8ce8248..631441488db6227962a9941fee1eb1ea08c6df7f 100644 (file)
@@ -1,3 +1,21 @@
+2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       * c.opt (Waddress): New.
+       * common.opt (Walways-true): Delete.
+       (Wstring-literal-comparison): Delete.
+       * doc/invoke.texi (Warning Options): Delete -Walways-true and
+       -Wstring-literal-comparison. Add -Waddress.
+       (Waddress): New.
+       (Walways-true): Delete.
+       (Wstring-literal-comparison): Delete.
+       * doc/extend.texi (#pragma GCC diagnostic): Use -Wformat
+       consistently instead of -Walways-true in example.
+       * c-opts.c (c_common_handle_option): -Waddress is enabled by -Wall.
+       * c-typeck.c (parser_build_binary_op): Replace
+       -Wstring-literal-comparison and -Walways-true with -Waddress.
+       * c-common.c (c_common_truthvalue_conversion): Replace -Walways-true
+       with -Waddress.
+       
 2007-02-19  Eric Botcazou  <ebotcazou@adacore.com>
 
        * tree-cfg.c (dump_function_to_file): Be prepared for functions
index d9a826d1d96980c5ce19a012ff4cb43b067b81c3..51fd22672cf3f4b9e8c75a7e6fb2e6cc89ddbeac 100644 (file)
@@ -2716,7 +2716,7 @@ c_common_truthvalue_conversion (tree expr)
        if (decl_with_nonnull_addr_p (inner))
          {
            /* Common Ada/Pascal programmer's mistake.  */
-           warning (OPT_Walways_true,
+           warning (OPT_Waddress,
                     "the address of %qD will always evaluate as %<true%>",
                     inner);
            return truthvalue_true_node;
index 76ad8271d7222551b3bafe9b0d4b0206c91227ad..2839e6683d016c195cc4a9bfce85b3549e8835b5 100644 (file)
@@ -395,9 +395,8 @@ c_common_handle_option (size_t scode, const char *arg, int value)
        warn_sign_compare = value;
       warn_switch = value;
       warn_strict_aliasing = value;
+      warn_address = value;
       warn_strict_overflow = value;
-      warn_string_literal_comparison = value;
-      warn_always_true = value;
       warn_array_bounds = value;
 
       /* Only warn about unknown pragmas that are not in system
index f6ba19e2842505dcddc73b262d9f7e7e7454f12d..d3495a9f71dec39cf0a94330f94941246781c05e 100644 (file)
@@ -2640,13 +2640,11 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1,
     {
       if ((code1 == STRING_CST && !integer_zerop (arg2.value))
          || (code2 == STRING_CST && !integer_zerop (arg1.value)))
-       warning (OPT_Wstring_literal_comparison,
-                "comparison with string literal");
+       warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour");
     }
   else if (TREE_CODE_CLASS (code) == tcc_comparison
           && (code1 == STRING_CST || code2 == STRING_CST))
-    warning (OPT_Wstring_literal_comparison,
-            "comparison with string literal");
+    warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour");
 
   if (TREE_OVERFLOW_P (result.value) 
       && !TREE_OVERFLOW_P (arg1.value) 
@@ -8025,7 +8023,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
        {
          if (TREE_CODE (op0) == ADDR_EXPR
              && decl_with_nonnull_addr_p (TREE_OPERAND (op0, 0)))
-           warning (OPT_Walways_true, "the address of %qD will never be NULL",
+           warning (OPT_Waddress, "the address of %qD will never be NULL",
                     TREE_OPERAND (op0, 0));
          result_type = type0;
        }
@@ -8033,7 +8031,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
        {
          if (TREE_CODE (op1) == ADDR_EXPR
              && decl_with_nonnull_addr_p (TREE_OPERAND (op1, 0)))
-           warning (OPT_Walways_true, "the address of %qD will never be NULL",
+           warning (OPT_Waddress, "the address of %qD will never be NULL",
                     TREE_OPERAND (op1, 0));
          result_type = type1;
        }
index 512882bc64b70290a911075ded3c2d7ff07221aa..c384f52b3a4c5a428744d46b199b620a64b11ac1 100644 (file)
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -116,6 +116,10 @@ Wabi
 C++ ObjC++ Var(warn_abi) Warning
 Warn about things that will change when compiling with an ABI-compliant compiler
 
+Waddress
+C ObjC C++ ObjC++ Var(warn_address) Warning
+Warn about suspicious uses of memory addresses
+
 Wall
 C ObjC C++ ObjC++ Warning
 Enable most warning messages
index c6a95574be943639c7414b02dc7e61cb493cb63b..1be3b748d01b7a3656571ce5bbc9dc6772b05503 100644 (file)
@@ -74,10 +74,6 @@ Waggregate-return
 Common Var(warn_aggregate_return) Warning
 Warn about returning structures, unions or arrays
 
-Walways-true
-Common Var(warn_always_true) Warning
-Warn about comparisons that always evaluate to true
-
 Warray-bounds
 Common Var(warn_array_bounds)
 Warn if an array is accessed out of bounds
@@ -166,10 +162,6 @@ Wstrict-overflow=
 Common Joined UInteger
 Warn about optimizations that assume that signed overflow is undefined
 
-Wstring-literal-comparison
-Common Var(warn_string_literal_comparison) Warning
-Warn about comparisons to constant string literals
-
 Wswitch
 Common Var(warn_switch) Warning
 Warn about enumerated switches, with no default, missing a case
index a1f948d8fe97a6d29f6abcd078bb804ec8c4260e..0c6b90d7edda001d58eac36bba90d2257dd6fae9 100644 (file)
@@ -1,3 +1,10 @@
+2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
+       and -Walways-true with -Waddress.
+       * cvt.c (convert_to_void): Replace unconditional warning with
+       -Waddress.
+
 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
 
        * decl.c, tree.c: Fix comment typos.
index 497179b3bbc5e3244e2a8ad7643b3ff302a83fc7..4e628a5dd929a6fe3ae7e938cd12406d21d7b897 100644 (file)
@@ -929,7 +929,7 @@ convert_to_void (tree expr, const char *implicit)
     else if (implicit && probe == expr && is_overloaded_fn (probe))
       {
        /* Only warn when there is no &.  */
-       warning (0, "%s is a reference, not call, to function %qE",
+       warning (OPT_Waddress, "%s is a reference, not call, to function %qE",
                 implicit, expr);
        if (TREE_CODE (expr) == COMPONENT_REF)
          expr = TREE_OPERAND (expr, 0);
index 68b7a04eff4d7c807d01f2ffb548115b5b118f6b..63f03ccecded297fa015a33f4844c0d1a43b1939 100644 (file)
@@ -3319,8 +3319,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
                 "comparing floating point with == or != is unsafe");
       if ((TREE_CODE (orig_op0) == STRING_CST && !integer_zerop (op1))
          || (TREE_CODE (orig_op1) == STRING_CST && !integer_zerop (op0)))
-       warning (OPT_Wstring_literal_comparison,
-                "comparison with string literal");
+       warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour");
 
       build_type = boolean_type_node;
       if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
@@ -3337,7 +3336,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
        {
          if (TREE_CODE (op0) == ADDR_EXPR
              && decl_with_nonnull_addr_p (TREE_OPERAND (op0, 0)))
-           warning (OPT_Walways_true, "the address of %qD will never be NULL",
+           warning (OPT_Waddress, "the address of %qD will never be NULL",
                     TREE_OPERAND (op0, 0));
          result_type = type0;
        }
@@ -3346,7 +3345,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
        {
          if (TREE_CODE (op1) == ADDR_EXPR 
              && decl_with_nonnull_addr_p (TREE_OPERAND (op1, 0)))
-           warning (OPT_Walways_true, "the address of %qD will never be NULL",
+           warning (OPT_Waddress, "the address of %qD will never be NULL",
                     TREE_OPERAND (op1, 0));
          result_type = type1;
        }
@@ -3495,8 +3494,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
     case GT_EXPR:
       if (TREE_CODE (orig_op0) == STRING_CST
          || TREE_CODE (orig_op1) == STRING_CST)
-       warning (OPT_Wstring_literal_comparison,
-                "comparison with string literal");
+       warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour");
 
       build_type = boolean_type_node;
       if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE)
index 2417a73d20a1fdd4499cb28ebbf8f094ebaaad36..57cc6e1c660b6c4cf88305b5e083b62be53b58d9 100644 (file)
@@ -10149,8 +10149,8 @@ option.
 
 @example
 #pragma GCC diagnostic warning "-Wformat"
-#pragma GCC diagnostic error "-Walways-true"
-#pragma GCC diagnostic ignored "-Walways-true"
+#pragma GCC diagnostic error "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat"
 @end example
 
 Note that these pragmas override any command line options.  Also,
index 3bc4d9001849435912d846990f278289d9100a8f..047104c7391e21047424b6eab289f8b85906e978 100644 (file)
@@ -223,7 +223,7 @@ Objective-C and Objective-C++ Dialects}.
 @item Warning Options
 @xref{Warning Options,,Options to Request or Suppress Warnings}.
 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
--w  -Wextra  -Wall  -Waggregate-return -Walways-true -Warray-bounds @gol
+-w  -Wextra  -Wall  -Waddress  -Waggregate-return -Warray-bounds @gol
 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
 -Wchar-subscripts -Wclobbered  -Wcomment @gol
 -Wconversion -Wcoverage-mismatch -Wno-deprecated-declarations @gol
@@ -249,7 +249,6 @@ Objective-C and Objective-C++ Dialects}.
 -Wsign-compare  -Wstack-protector @gol
 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
--Wstring-literal-comparison @gol
 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
@@ -3381,18 +3380,27 @@ an incorrect result when the signed value is converted to unsigned.
 This warning is also enabled by @option{-Wextra}; to get the other warnings
 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
 
+@item -Waddress
+@opindex Waddress
+@opindex Wno-address
+Warn about suspicious uses of memory addresses. These include using
+the address of a function in a conditional expression, such as
+@code{void func(void); if (func)}, and comparisons against the memory
+address of a string literal, such as @code{if (x == "abc")}.  Such
+uses typically indicate a programmer error: the address of a function
+always evaluates to true, so their use in a conditional usually
+indicate that the programmer forgot the parentheses in a function
+call; and comparisons against string literals result in unspecified
+behavior and are not portable in C, so they usually indicate that the
+programmer intended to use @code{strcmp}.  This warning is enabled by
+@option{-Wall}.
+
 @item -Waggregate-return
 @opindex Waggregate-return
 Warn if any functions that return structures or unions are defined or
 called.  (In languages where you can return an array, this also elicits
 a warning.)
 
-@item -Walways-true
-@opindex Walways-true
-Warn about comparisons which are always true such as testing if
-unsigned values are greater than or equal to zero.  This warning is
-enabled by @option{-Wall}.
-
 @item -Wno-attributes
 @opindex Wno-attributes
 @opindex Wattributes
@@ -3742,15 +3750,6 @@ imply anything.
 This option is only active when @option{-fstack-protector} is active.  It
 warns about functions that will not be protected against stack smashing.
 
-@item -Wstring-literal-comparison
-@opindex Wstring-literal-comparison
-Warn about suspicious comparisons to string literal constants.  In C,
-direct comparisons against the memory address of a string literal, such
-as @code{if (x == "abc")}, typically indicate a programmer error, and
-even when intentional, result in unspecified behavior and are not portable.
-Usually these warnings alert that the programmer intended to use
-@code{strcmp}.  This warning is enabled by @option{-Wall}.
-
 @item -Woverlength-strings
 @opindex Woverlength-strings
 Warn about string constants which are longer than the ``minimum
index 2101ceed194fd63072585dd90287d5722524518b..1957a416ed4e7d7143e4ee3e8c02d418d63b79c5 100644 (file)
@@ -1,3 +1,27 @@
+2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       * gcc.dg/20031012-1.c: Replace -Walways-true with -Waddress.
+       * gcc.dg/Walways-true-1.c: Likewise.
+       * gcc.dg/weak/weak-3.c: Likewise.
+       * gcc.dg/Werror-1.c: Likewise.
+       * gcc.dg/Werror-3.c: Likewise.
+       * gcc.dg/Werror-4.c: Likewise.
+       * gcc.dg/Werror-5.c: Likewise.
+       * gcc.dg/Werror-6.c: Likewise.
+       * gcc.dg/Werror-7.c: Likewise.
+       * gcc.dg/Werror-8.c: Likewise.
+       * gcc.dg/Werror-10.c: Likewise.
+       * gcc.dg/Werror-11.c: Likewise.
+       * gcc.dg/Werror-12.c: Likewise.
+       * g++.old-deja/g++.mike/warn8.C: Likewise.
+       * g++.dg/warn/Walways-true-1.C: Likewise.
+       * g++.dg/warn/Walways-true-2.C: Likewise.
+       * g++.dg/warn/noeffect8.C: Warn only with -Waddress.
+       * g++.dg/warn/Wstring-literal-comparison-1.C: Replace
+       -Wstring-literal-comparison with -Waddress.
+       * gcc.dg/Wstring-literal-comparison-4.c: Replace
+       -Wno-string-literal-comparison with -Wno-address.
+       
 2007-02-19  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/self_aggregate_with_call.adb: New test.
index 5102ca1a3773c132214712e1f44632be2d7cc718..6d22cce993b2efabf18af441e8680f179c5c126a 100644 (file)
@@ -1,8 +1,8 @@
-// Test -Walways-true for testing an address against NULL.
+// Test -Waddress for testing an address against NULL.
 // Origin: Ian Lance Taylor <iant@google.com>
 
 // { dg-do compile}
-// { dg-options "-Walways-true" }
+// { dg-options "-Waddress" }
 
 extern int foo (int);
 
index 540856650e60d1b542ade4f0e0e5ff2abc7f9566..51bc686276147bac10a07af563a7984b0e49e09d 100644 (file)
@@ -4,7 +4,7 @@
 // Origin: Ian Lance Taylor <iant@google.com>
 
 // { dg-do compile}
-// { dg-options "-Walways-true" }
+// { dg-options "-Waddress" }
 // { dg-require-weak "" }
 
 extern int foo (int) __attribute__ ((weak));
index c5dea463b51d05ad60f0b79dec8eaf6f525c7a18..97e317644d50aab6e860c4913d9160159fff478c 100644 (file)
@@ -1,6 +1,6 @@
 /* PR c/7776 */
 /* { dg-do compile } */
-/* { dg-options "-Wstring-literal-comparison" } */
+/* { dg-options "-Waddress" } */
 
 int test1(char *ptr)
 {
index 27f25f3ca98241aefa58f2c2577e44e299e1d895..f2a711aeb7135f7e269ef39cf6a8129b6f3ab66b 100644 (file)
@@ -1,6 +1,6 @@
 /* PR c/7776 */
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wno-string-literal-comparison" } */
+/* { dg-options "-Wall -Wno-address" } */
 
 int test1(char *ptr)
 {
index 4eb7f1bd1afcabe0f28e609c8d83304912eb21d4..48edfdea6855874e80242dacac7254a87aebf23a 100644 (file)
@@ -1,4 +1,6 @@
 // PR c++/26696, 28996
+// { dg-do compile }
+// { dg-options "-Waddress" }
 
 struct A
 {
index 18b193722d399d698bd45326b76831f0a896c552..ea9dfb8681c49948ba2fff325fac9d7afd4ecf86 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do assemble  }
-// { dg-options "-Walways-true" }
+// { dg-options "-Waddress" }
 
 struct foo {
   bool test();
index cdfed68e09a92f6d2f680e5682c789aa00b5ea5c..f83e1d3f57c33427124368b89ab76a2a895379ba 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-Walways-true" } */
+/* { dg-options "-Waddress" } */
 /* Origin: Andrew Morton <akpm@osdl.org> */
 /* Warn if a function addres of a non-weak function is used
    as a truth value.  */
index f531e8f4b79c6596c0698aa5d8fe54c3c1adab30..299932fcf55898a17417c191a301fb33265e2a22 100644 (file)
@@ -1,8 +1,8 @@
-/* Test -Walways-true for testing an address against NULL.
+/* Test -Waddress for testing an address against NULL.
    Origin: Ian Lance Taylor <iant@google.com>.  */
 
 /* { dg-do compile} */
-/* { dg-options "-Walways-true" } */
+/* { dg-options "-Waddress" } */
 
 extern int foo (int);
 
index cab897b4e3d8cb2da45f7eee91ffdd0f5da83034..c14857eaee618b4a754d3c64847d26513e6da72f 100644 (file)
@@ -4,7 +4,7 @@
    Origin: Ian Lance Taylor <iant@google.com>.  */
 
 /* { dg-do compile} */
-/* { dg-options "-Walways-true" } */
+/* { dg-options "-Waddress" } */
 /* { dg-require-weak "" } */
 
 extern int foo (int) __attribute__ ((weak));
index d50e07c45f273ed90b8151e7c690b41337f98953..7984740ca88d5108dfc268fa2dae1a1dde4387d9 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Walways-true -Wattributes -Werror" } */
+/* { dg-options "-Waddress -Wattributes -Werror" } */
 /* { dg-warning "warnings being treated as errors" "" {target "*-*-*"} 0 } */
 
 /* This is the first in a series of test cases that test the
@@ -7,7 +7,7 @@
    diagnostic error foo.  This one has all the bits we're testing, the
    others are subsets of this one.  */
 
-#pragma GCC diagnostic error "-Walways-true"
+#pragma GCC diagnostic error "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "warning: .* attribute directive ignored" } */
 
index 3e2c9dffa4f140aef94edb5a369feef927eb6775..eeadf512b5ba50553674cf878cc22ab7ef8df7c8 100644 (file)
@@ -4,7 +4,7 @@
 
 /* Make sure #pragma can work with -Werror.  */
 
-#pragma GCC diagnostic error "-Walways-true"
+#pragma GCC diagnostic error "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "warning: .* attribute directive ignored" } */
 
index 14aae3129f8c94402a11e1169a6ca1a5a49120a3..493ded044a828085ee1774b20674ec57ff75f63d 100644 (file)
@@ -4,7 +4,7 @@
 
 /* Make sure #pragma can override -Werror.  */
 
-#pragma GCC diagnostic warning "-Walways-true"
+#pragma GCC diagnostic warning "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "warning: .* attribute directive ignored" } */
 
index 0cb1f78f8054c91a18b612db3388c64d146e84d6..4f0bd17623ba5a75e0336a4efda15c377ab600d2 100644 (file)
@@ -1,9 +1,9 @@
 /* { dg-do compile } */
-/* { dg-options "-Wattributes -Walways-true" } */
+/* { dg-options "-Wattributes -Waddress" } */
 
 /* Make sure #pragma can override -Wfoo.  */
 
-#pragma GCC diagnostic ignored "-Walways-true"
+#pragma GCC diagnostic ignored "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "attribute directive ignored" } */
 
index a994714446c1945c64b214d43fb02f92aa8d4650..b95dd8b6a3dfc419dbf45415b05dd766cb42de2b 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Walways-true -Wattributes" } */
+/* { dg-options "-Waddress -Wattributes" } */
 
 /* Make sure the command line option enables the warning.  */
 
index 45d217b32331899e0d6e298d9521bab2301ccf8a..2c66fc9d4773c818bcb95f1d99cf6548dca5e029 100644 (file)
@@ -3,7 +3,7 @@
 
 /* Make sure the pragma enables the error.  */
 
-#pragma GCC diagnostic error "-Walways-true"
+#pragma GCC diagnostic error "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "warning: .* attribute directive ignored" } */
 
index 39125904dfa0fe388e505e08e23282af47a4be05..40d3cd1f7ad3afa0db4ce852467eb73f550df82a 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Walways-true -Wattributes -Werror" } */
+/* { dg-options "-Waddress -Wattributes -Werror" } */
 /* { dg-warning "warnings being treated as errors" "" {target "*-*-*"} 0 } */
 
 /* Make sure -Werror turns warnings in to errors.  */
index 11f28b0aa6a078ac9bed072da394b9b8ae13a3bc..62f0e4f40413f91e1b4bc80f325e55343aa8821d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wattributes -Werror=always-true" } */
+/* { dg-options "-Wattributes -Werror=address" } */
 
 /* Make sure -Werror-foo emits an error and not a warning */
 
index e6671991f5a2d73f299af7d2fda80446812986a4..9829ce9e4f744745163a69fb6283fd89f29a6581 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Walways-true -Werror -Wno-error=always-true -Wattributes" } */
+/* { dg-options "-Waddress -Werror -Wno-error=address -Wattributes" } */
 /* { dg-warning "warnings being treated as errors" "" {target "*-*-*"} 0 } */
 
 /* Make sure -Wno-error= overrides -Werror.  */
index ec70a2e8eab8b6f7dade4e1a965f036f05060ece..5051b7aa47ccdc487c62cdf5fb2bfa2c98a4befc 100644 (file)
@@ -3,7 +3,7 @@
 
 /* Make sure #pragma can enable a warning.  */
 
-#pragma GCC diagnostic warning "-Walways-true"
+#pragma GCC diagnostic warning "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "warning: .* attribute directive ignored" } */
 
index 5b287793f556f2adbd17d2470ef52851d50f2ae1..30326a4799adc1771cd98060b3e118f206eab3c4 100644 (file)
@@ -3,7 +3,7 @@
 
 /* Make sure #pragma can enable a warning as an error.  */
 
-#pragma GCC diagnostic error "-Walways-true"
+#pragma GCC diagnostic error "-Waddress"
 
 void __attribute__((dj)) bar() { }     /* { dg-warning "warning: .* attribute directive ignored" } */
 
index c5dea463b51d05ad60f0b79dec8eaf6f525c7a18..97e317644d50aab6e860c4913d9160159fff478c 100644 (file)
@@ -1,6 +1,6 @@
 /* PR c/7776 */
 /* { dg-do compile } */
-/* { dg-options "-Wstring-literal-comparison" } */
+/* { dg-options "-Waddress" } */
 
 int test1(char *ptr)
 {
index 27f25f3ca98241aefa58f2c2577e44e299e1d895..f2a711aeb7135f7e269ef39cf6a8129b6f3ab66b 100644 (file)
@@ -1,6 +1,6 @@
 /* PR c/7776 */
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wno-string-literal-comparison" } */
+/* { dg-options "-Wall -Wno-address" } */
 
 int test1(char *ptr)
 {
index d8c9a21908441b0f2d53fea9b640fb711e65a641..6ad94731affba8a7f6fb67dbe4e3076bf2b351ea 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-weak "" } */
-/* { dg-options "-Walways-true" } */
+/* { dg-options "-Waddress" } */
 /* Warning when addr convert to bool always gives known result.
    Ada/Pascal programmers sometimes write 0-param functions without
    (), and might as well warn on variables, too.  */
index 7182168cfc4547874e1f0031510b4e94a730a33a..21e5fa09c28b8aac16857df9d6d880ce3c325063 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-require-alias "" } */
 /* { dg-require-weak "" } */
-/* { dg-options "-fno-common -Walways-true" } */
+/* { dg-options "-fno-common -Waddress" } */
 
 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */