[Webkit-unassigned] [Bug 247890] New: [CMake] No need to build with -Wwrite-strings

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 14 05:16:10 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=247890

            Bug ID: 247890
           Summary: [CMake] No need to build with -Wwrite-strings
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CMake
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221114/e971440d/attachment.htm>


More information about the webkit-unassigned mailing list