Bug 247890
| Summary: | [CMake] No need to build with -Wwrite-strings | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
| Component: | CMake | Assignee: | Michael Catanzaro <mcatanzaro> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Michael Catanzaro
The -Wwrite-strings warning is enabled by default for C++ code, and its benefit in C code is not really so amazing as to justify its use considering how few C source files we have, so specifying it manually is not very useful. From gcc(1):
-Wwrite-strings
When compiling C, give string constants the type "const char[length]"
so that copying the address of one into a non-"const" "char *"
pointer produces a warning. These warnings help you find at compile
time code that can try to write into a string constant, but only if
you have been very careful about using "const" in declarations and
prototypes. Otherwise, it is just a nuisance. This is why we did not
make -Wall request these warnings.
When compiling C++, warn about the deprecated conversion from string
literals to "char *". This warning is enabled by default for C++
programs.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/6471
EWS
Committed 256674@main (0ce633e16f78): <https://commits.webkit.org/256674@main>
Reviewed commits have been landed. Closing PR #6471 and removing active labels.