Bug 224826 - Static asserts in WasmAirIRGenerator.cpp and WasmB3IRGenerator.cpp trigger -Wnonnull warnings with GCC 11
Summary: Static asserts in WasmAirIRGenerator.cpp and WasmB3IRGenerator.cpp trigger -W...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-20 12:54 PDT by Michael Catanzaro
Modified: 2021-04-23 01:08 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.70 KB, patch)
2021-04-20 13:02 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2021-04-20 12:54:36 PDT
These asserts are understandably triggering -Wnonnull warnings:

static_assert(sizeof(decltype(static_cast<Instance*>(nullptr)->cachedStackLimit())) == sizeof(uint64_t), "");

In https://bugs.webkit.org/show_bug.cgi?id=224452#c26, Jonathan Wakely has a tip to rewrite the assert:

static_assert(sizeof(std::declval<Instance*>()->cachedStackLimit()) == sizeof(uint64_t), "");

It works.
Comment 1 Michael Catanzaro 2021-04-20 13:02:43 PDT
Created attachment 426584 [details]
Patch
Comment 2 EWS 2021-04-20 19:38:22 PDT
Committed r276343 (236821@main): <https://commits.webkit.org/236821@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426584 [details].
Comment 3 Radar WebKit Bug Importer 2021-04-23 01:08:19 PDT
<rdar://problem/77061153>