Skip to content

Commit

Permalink
Cherry-pick 275934@main (ca6b301). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=270770

    [Clang] GeneratedSerializers.cpp(3716,11): error: offset of on non-standard-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

Canonical link: https://commits.webkit.org/274313.89@webkitglib/2.44
  • Loading branch information
fujii authored and mcatanzaro committed Mar 15, 2024
1 parent 629d941 commit b67becf
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 @@ -1002,11 +1002,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 @@ -1091,9 +1089,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 b67becf

Please sign in to comment.