re PR c++/8586 (-Wwrite-strings should be included in -Wall)

2006-11-19  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        PR c++/8586
        * c-opts.c (c_common_handle_option): Enable -Wwrite-strings if
        -Wall.

testsuite/
2006-11-19  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        PR c++/8586
        * g++.dg/warn/Wall-write-strings.C: New.

From-SVN: r119009
This commit is contained in:
Gabriel Dos Reis 2006-11-20 01:03:49 +00:00 committed by Gabriel Dos Reis
parent e5dfa5b1be
commit 7f420d0d64
4 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-11-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/8586
* c-opts.c (c_common_handle_option): Enable -Wwrite-strings if -Wall.
2006-11-19 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/29114

View File

@ -416,6 +416,8 @@ c_common_handle_option (size_t scode, const char *arg, int value)
/* C++-specific warnings. */
warn_reorder = value;
warn_nontemplate_friend = value;
if (value > 0)
warn_write_strings = true;
}
cpp_opts->warn_trigraphs = value;

View File

@ -1,3 +1,8 @@
2006-11-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/8586
* g++.dg/warn/Wall-write-strings.C: New.
2006-11-19 Erik Edelmann <eedelman@gcc.gnu.org>
* gfortran.dg/alloc_comp_constraint_5.f90: New.

View File

@ -0,0 +1,7 @@
// PR 8586
// { dg-do compile }
// { dg-options "-Wall" }
char* foo = "foo"; // { dg-warning "" }
const char* bar = "bar";