Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1e727c2cb404763c4acba240b5d98395f3312b0e
https://github.com/WebKit/WebKit/commit/1e727c2cb404763c4acba240b5d98395f3312b0e
Author: Frédéric Wang <[email protected]>
Date: 2025-07-09 (Wed, 09 Jul 2025)
Changed paths:
M Source/WTF/wtf/Compiler.h
M Source/WebKit/SaferCPPExpectations/ForwardDeclCheckerExpectations
M Source/WebKit/SaferCPPExpectations/NoUncheckedPtrMemberCheckerExpectations
M Source/WebKit/SaferCPPExpectations/NoUncountedMemberCheckerExpectations
M Source/WebKit/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations
M Source/WebKit/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithDeferSendingOptionMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithSpanOfConstMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessages.h
M Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h
Log Message:
-----------
Suppress ForwardDeclChecker for headers generated by
Scripts/webkit/messages.py
https://bugs.webkit.org/show_bug.cgi?id=295621
Reviewed by Ryosuke Niwa.
Message types are only instantiated temporarily to encode / decode bytes,
there is no inherent unsafety in using raw references or pointers there.
This patch introduces new macros to suppress ForwardDeclChecker errors
and use them for *Messages.h headers generated by the messages.py script.
* Source/WTF/wtf/Compiler.h: Introduce new macros to suppress
alpha.webkit.ForwardDeclChecker warnings for class members and
function arguments. This checker is available in the webkit branch of
Ryosuke's llvm fork, was merged in upstream llvm via
https://github.com/llvm/llvm-project/pull/130554 but is not currently
available in the latest release of llvm (20.x) or in Apple's clang version.
* Source/WebKit/SaferCPPExpectations/ForwardDeclCheckerExpectations: Remove
*Messages.h files.
* Source/WebKit/SaferCPPExpectations/NoUncheckedPtrMemberCheckerExpectations:
Ditto.
* Source/WebKit/SaferCPPExpectations/NoUncountedMemberCheckerExpectations:
Ditto.
* Source/WebKit/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations:
Ditto.
* Source/WebKit/SaferCPPExpectations/UncountedCallArgsCheckerExpectations:
Ditto.
* Source/WebKit/Scripts/webkit/messages.py:
(function_parameter_type): Move builtin_types array out of this function, so it
can be used by function_parameter_requires_suppress_forward_decl.
(function_parameter_requires_suppress_forward_decl): New helper function to
indicate parameters that require to suppress ForwardDeclChecker error.
Essentially those for which function_parameter_type() returns a reference
and that are not listed in type in types_that_cannot_be_forward_declared().
(message_to_struct_declaration): Add SUPPRESS_FORWARD_DECL_MEMBER in front of
m_parameter declarations and SUPPRESS_FORWARD_DECL_ARG macros in front of
of 'encoder << m_parameter' instructions.
* Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessages.h:
Regenerate expectation.
* Source/WebKit/Scripts/webkit/tests/TestWithDeferSendingOptionMessages.h:
Ditto.
* Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h: Ditto.
* Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h: Ditto.
* Source/WebKit/Scripts/webkit/tests/TestWithSpanOfConstMessages.h: Ditto.
* Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessages.h: Ditto.
* Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessages.h: Ditto.
* Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h: Ditto.
Canonical link: https://commits.webkit.org/297178@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes