Skip to content

[WTF] Fix -Wc++23-lambda-attributes warnings#52369

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
ddkilzer:eng/WTF-Fix-Wc-23-lambda-attributes-warnings
Oct 16, 2025
Merged

[WTF] Fix -Wc++23-lambda-attributes warnings#52369
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
ddkilzer:eng/WTF-Fix-Wc-23-lambda-attributes-warnings

Conversation

@ddkilzer
Copy link
Contributor

@ddkilzer ddkilzer commented Oct 15, 2025

@ddkilzer ddkilzer self-assigned this Oct 15, 2025
@ddkilzer ddkilzer requested a review from cdumez October 15, 2025 05:13
Comment on lines 595 to 596
#define IGNORE_CXX23_LAMBDA_ATTRIBUTES_BEGIN IGNORE_CLANG_WARNINGS_BEGIN("c++23-lambda-attributes")
#define IGNORE_CXX23_LAMBDA_ATTRIBUTES_END IGNORE_CLANG_WARNINGS_END
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way to fix this is to add -Wno-c++23-lambda-attributes to Configurations/CommonBase.xcconfig so we just ignore these warnings everywhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I don't understand is that we're supposed to be building with -std=c++23 so why are we getting this warning in the first place? Did we fail to enable C++23 in some places?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I wonder if it’s because the WTF module map specifies a version < 23

Copy link
Contributor

@cdumez cdumez Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    /Applications/Xcode.app/Contents/Developer/Toolchains/OSX26.2.xctoolchain/usr/bin/clang -x c++ -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fbuild-session-file\=/Users/cdumez/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session @/Volumes/Work/WebKit/OpenSource/WebKitBuild/JavaScriptCore.build/Debug/JavaScriptCore.build/VerifyModule/JavaScriptCore/c++-gnu++20-arm64e-apple-macos26.2-none/fe7502429db486ee15814c0d75f1b9fd-common-args.resp -MMD -MT dependencies -MF /Volumes/Work/WebKit/OpenSource/WebKitBuild/JavaScriptCore.build/Debug/JavaScriptCore.build/VerifyModule/JavaScriptCore/c++-gnu++20-arm64e-apple-macos26.2-none/Test.d --serialize-diagnostics /Volumes/Work/WebKit/OpenSource/WebKitBuild/JavaScriptCore.build/Debug/JavaScriptCore.build/VerifyModule/JavaScriptCore/c++-gnu++20-arm64e-apple-macos26.2-none/Test.dia -c /Volumes/Work/WebKit/OpenSource/WebKitBuild/JavaScriptCore.build/Debug/JavaScriptCore.build/VerifyModule/JavaScriptCore/c++/Test.cpp -o /Volumes/Work/WebKit/OpenSource/WebKitBuild/JavaScriptCore.build/Debug/JavaScriptCore.build/VerifyModule/JavaScriptCore/c++-gnu++20-arm64e-apple-macos26.2-none/Test.o

Given the c++-gnu++20 in the line, I suspect we forgot to turn on C++23 for some test project in JSC? Maybe we can fix that instead?

@rr-codes
Copy link
Contributor

are we not able to just change WTF to use c++2b / c++23 instead?

@cdumez
Copy link
Contributor

cdumez commented Oct 15, 2025

are we not able to just change WTF to use c++2b / c++23 instead?

My understanding was that c++2b and c++23 turn on the same features. My suspicion is that there is a project still building with c++20 in our codebase (In JSC land) that generates these warnings.

@cdumez
Copy link
Contributor

cdumez commented Oct 15, 2025

JavaScriptCore VerifyModuleC /Volumes/Work/WebKit/OpenSource/WebKitBuild/Debug/JavaScriptCore.framework "" "" arm64e c++ gnu++20 "" com.apple.compilers.llvm.clang.1_0.verify_module 

@rr-codes
Copy link
Contributor

JavaScriptCore VerifyModuleC /Volumes/Work/WebKit/OpenSource/WebKitBuild/Debug/JavaScriptCore.framework "" "" arm64e c++ gnu++20 "" com.apple.compilers.llvm.clang.1_0.verify_module 

oh, my suspicion was very close #52369 (comment)

@ddkilzer
Copy link
Contributor Author

Okay, looking at fixing the module verification now.

@ddkilzer ddkilzer force-pushed the eng/WTF-Fix-Wc-23-lambda-attributes-warnings branch from d969252 to 1c144ce Compare October 15, 2025 20:50
@ddkilzer ddkilzer requested a review from emw-apple as a code owner October 15, 2025 20:50
MODULE_VERIFIER_SUPPORTED_LANGUAGES_YES = objective-c++ c++;

MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = $(MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS_$(WK_HAS_VALID_JSC_PRIVATE_MODULE));
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS_ = gnu17;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the gnu17 isnt doing much on these 3 lines since ObjC verification is disabled in JSC for the time being

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so what do you recommend setting? No value? I was cribbing values from 301180@main.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to help here, but I'm outside my area of expertise. (Assume I know next to nothing about modules.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya I think no value for the _ and NO cases, and just gnu++whatever for the YES value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just gnu++whatever for the YES value

Any ideas how can I find out the default? Oh, maybe the aforementioned gnu++20?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value should be whatever the project uses, which in our case is gnu++23 (I think? or c++23, I forget the difference)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's this from Source/JavaScriptCore/Configurations/Base.xcconfig:

CLANG_CXX_LANGUAGE_STANDARD = c++2b;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welp, not that:

Source/JavaScriptCore/JavaScriptCore.xcodeproj: warning: Unsupported module verifier language standard "c++2b" (in target 'JavaScriptCore' from project 'JavaScriptCore')

Seems like I need to use just c++23.

@ddkilzer ddkilzer requested a review from rr-codes October 15, 2025 21:04
@ddkilzer ddkilzer force-pushed the eng/WTF-Fix-Wc-23-lambda-attributes-warnings branch from 1c144ce to a8aea76 Compare October 15, 2025 23:30
@ddkilzer ddkilzer added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 16, 2025
<https://bugs.webkit.org/show_bug.cgi?id=300747>
<rdar://162639803>

Reviewed by Chris Dumez.

* Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig:
(MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS): Add.
- Set variable based on the value of WK_HAS_VALID_JSC_PRIVATE_MODULE.
  This is similar to one of the changes in 301180@main for
  Source/WebKit/Configurations/WebKit.xcconfig.

Canonical link: https://commits.webkit.org/301598@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WTF-Fix-Wc-23-lambda-attributes-warnings branch from a8aea76 to 1e73347 Compare October 16, 2025 02:55
@webkit-commit-queue
Copy link
Collaborator

Committed 301598@main (1e73347): https://commits.webkit.org/301598@main

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

@webkit-commit-queue webkit-commit-queue merged commit 1e73347 into WebKit:main Oct 16, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 16, 2025
@ddkilzer ddkilzer deleted the eng/WTF-Fix-Wc-23-lambda-attributes-warnings branch October 16, 2025 02:56
@ddkilzer ddkilzer added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants