This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
"Joe" == Joe Buck <Joe.Buck@synopsys.COM> writes:
Joe> The answer, I think, is for the compiler never to assume that Joe> there is such a thing as a string constant....
I'm wondering whether it's worth while to spend any energy on this. Perhaps I'm naive -- but I remember writable string literals from Fortran-2 where they were universally recognized as a language design error, which could produce bizarre program misbehavior. As a result, I think of any program that depends on writable string literals as being defective.
So, what's wrong with removing the flag (with a one version lag via depreciation, if desired -- though I would not push for that) and letting people fix the bugs that are hidden by this flag, instead?
That may be the right solution, but remember that we're talking about bugs that will be found at runtime, not at compile time. The symptom will be a segfault, perhaps one that only occurs in rarely executed code paths.
For C++, for example, it might be a good idea to add -Wwrite-strings to -Wall. That's probably less justifiable for C, but in C++ we really are talking about a conversion that the standard officially says is deprecated.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |