Skip to content

Commit

Permalink
[Clang] GeneratedSerializers.cpp(3716,11): error: offset of on non-st…
Browse files Browse the repository at this point in the history
…andard-layout type 'WebKit::AudioTrackPrivateRemoteConfiguration' [-Werror,-Winvalid-offsetof]

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

Reviewed by Alex Christensen.

Clang 18.1.1 reports a warning for GeneratedSerializers.cpp:

> DerivedSources\GeneratedSerializers.cpp(3716,11): error: offset of on non-standard-layout type 'WebKit::AudioTrackPrivateRemoteConfiguration' [-Werror,-Winvalid-offsetof]
>  3716 |         , offsetof(WebKit::AudioTrackPrivateRemoteConfiguration, enabled)
>       |           ^                                                      ~~~~~~~

generate-serializers.py already suppresses the warning for GCC.

* Source/WebKit/Scripts/generate-serializers.py:
Ignore `invalid-offsetof` warning both for GCC and Clang.

Canonical link: https://commits.webkit.org/275934@main
  • Loading branch information
fujii committed Mar 11, 2024
1 parent dbeae57 commit ca6b301
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Source/WebKit/Scripts/generate-serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,11 +1128,9 @@ def generate_impl(serialized_types, serialized_enums, headers, generating_webkit
result.append('};')
result.append('template<> struct VirtualTableAndRefCountOverhead<false, false> { };')
result.append('')
# GCC is less generous with its interpretation of "Use of the offsetof macro with a
# type other than a standard-layout class is conditionally-supported".
result.append('#if COMPILER(GCC)')
# GCC and Clang>=18 are less generous with their interpretation of "Use of the offsetof macro
# with a type other than a standard-layout class is conditionally-supported".
result.append('IGNORE_WARNINGS_BEGIN("invalid-offsetof")')
result.append('#endif')
result.append('')
result.append('namespace IPC {')
result.append('')
Expand Down Expand Up @@ -1215,9 +1213,7 @@ def generate_impl(serialized_types, serialized_enums, headers, generating_webkit
result.append('')
result.append('} // namespace WTF')
result.append('')
result.append('#if COMPILER(GCC)')
result.append('IGNORE_WARNINGS_END')
result.append('#endif')
result.append('')
return '\n'.join(result)

Expand Down

0 comments on commit ca6b301

Please sign in to comment.