Bug 309174
| Summary: | Build warnings with Clang 21 and libstdc++ 16 | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
| Component: | WebKitGTK | Assignee: | Michael Catanzaro <mcatanzaro> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Michael Catanzaro
[457/9707] Building C object Source/bmalloc/CMakeFiles/bmalloc.dir/libpas/src/libpas/bmalloc_type.c.o
/home/mcatanzaro/Projects/WebKit/Source/bmalloc/libpas/src/libpas/bmalloc_type.c:62:32: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
62 | type_name_start_marker_ptr = strstr(name, type_name_start_marker);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcatanzaro/Projects/WebKit/Source/bmalloc/libpas/src/libpas/bmalloc_type.c:79:46: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
79 | flexible_array_member_marker = strstr(name, "primitiveHeapRefForTypeWithFlexibleArrayMember");
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[7513/9707] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/API/glib/JSCContext.cpp.o
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/API/glib/JSCContext.cpp:882:98: warning: the two-parameter std::span construction is unsafe as it can introduce mismatch between buffer size and the bound information [-Wunsafe-buffer-usage-in-container]
882 | JSValueRef result = evaluateScriptInContext(context->priv->jsContext.get(), String::fromUTF8(std::span(code, length < 0 ? strlen(code) : length)), uri, lineNumber, &exception);
| ^
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/API/glib/JSCContext.cpp:882:127: warning: function 'strlen' is unsafe [-Wunsafe-buffer-usage-in-libc-call]
882 | JSValueRef result = evaluateScriptInContext(context->priv->jsContext.get(), String::fromUTF8(std::span(code, length < 0 ? strlen(code) : length)), uri, lineNumber, &exception);
| ^~~~~~~~~~~~
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/API/glib/JSCContext.cpp:922:87: warning: the two-parameter std::span construction is unsafe as it can introduce mismatch between buffer size and the bound information [-Wunsafe-buffer-usage-in-container]
922 | JSValueRef result = evaluateScriptInContext(objectContext.get(), String::fromUTF8(std::span(code, length < 0 ? strlen(code) : length)), uri, lineNumber, &exception);
| ^
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/API/glib/JSCContext.cpp:922:116: warning: function 'strlen' is unsafe [-Wunsafe-buffer-usage-in-libc-call]
922 | JSValueRef result = evaluateScriptInContext(objectContext.get(), String::fromUTF8(std::span(code, length < 0 ? strlen(code) : length)), uri, lineNumber, &exception);
| ^~~~~~~~~~~~
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/API/glib/JSCContext.cpp:982:63: warning: the two-parameter std::span construction is unsafe as it can introduce mismatch between buffer size and the bound information [-Wunsafe-buffer-usage-in-container]
982 | JSC::SourceCode source = JSC::makeSource(String::fromUTF8(std::span(code, length < 0 ? strlen(code) : length)), JSC::SourceOrigin { sourceURL }, JSC::SourceTaintedOrigin::Untainted,
| ^
/home/mcatanzaro/Projects/WebKit/Source/JavaScriptCore/API/glib/JSCContext.cpp:982:92: warning: function 'strlen' is unsafe [-Wunsafe-buffer-usage-in-libc-call]
982 | JSC::SourceCode source = JSC::makeSource(String::fromUTF8(std::span(code, length < 0 ? strlen(code) : length)), JSC::SourceOrigin { sourceURL }, JSC::SourceTaintedOrigin::Untainted,
| ^~~~~~~~~~~~
6 warnings generated.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/59901
EWS
Committed 308725@main (321a29a77cd5): <https://commits.webkit.org/308725@main>
Reviewed commits have been landed. Closing PR #59901 and removing active labels.