Bug 247890 - [CMake] No need to build with -Wwrite-strings
Summary: [CMake] No need to build with -Wwrite-strings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CMake (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-14 05:16 PST by Michael Catanzaro
Modified: 2022-11-14 14:43 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-11-14 05:16:10 PST
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.
Comment 1 Michael Catanzaro 2022-11-14 05:34:21 PST
Pull request: https://github.com/WebKit/WebKit/pull/6471
Comment 2 EWS 2022-11-14 14:43:35 PST
Committed 256674@main (0ce633e16f78): <https://commits.webkit.org/256674@main>

Reviewed commits have been landed. Closing PR #6471 and removing active labels.