re PR other/35648 (-Wall includes -Wwrite-strings)

2008-08-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 35648
	* doc/invoke.texi (Wwrite-strings): Clarify description.

From-SVN: r139517
parent 28c9884c
2008-08-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 35648
* doc/invoke.texi (Wwrite-strings): Clarify description.
2008-08-23 Ira Rosen <irar@il.ibm.com> 2008-08-23 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/37174 PR tree-optimization/37174
......
...@@ -3607,16 +3607,17 @@ two- or four-byte boundaries. ...@@ -3607,16 +3607,17 @@ two- or four-byte boundaries.
@opindex Wwrite-strings @opindex Wwrite-strings
@opindex Wno-write-strings @opindex Wno-write-strings
When compiling C, give string constants the type @code{const When compiling C, give string constants the type @code{const
char[@var{length}]} so that char[@var{length}]} so that copying the address of one into a
copying the address of one into a non-@code{const} @code{char *} non-@code{const} @code{char *} pointer will get a warning. These
pointer will get a warning; when compiling C++, warn about the warnings will help you find at compile time code that can try to write
deprecated conversion from string literals to @code{char *}. This into a string constant, but only if you have been very careful about
warning, by default, is enabled for C++ programs. using @code{const} in declarations and prototypes. Otherwise, it will
These warnings will help you find at just be a nuisance. This is why we did not make @option{-Wall} request
compile time code that can try to write into a string constant, but these warnings.
only if you have been very careful about using @code{const} in
declarations and prototypes. Otherwise, it will just be a nuisance; When compiling C++, warn about the deprecated conversion from string
this is why we did not make @option{-Wall} request these warnings. literals to @code{char *}. This warning is enabled by default for C++
programs.
@item -Wclobbered @item -Wclobbered
@opindex Wclobbered @opindex Wclobbered
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment