Bug 269360

Summary: [WPE] REGRESSION(274544@main): Build fails due to Clang -Wcast-align errors
Product: WebKit Reporter: Adrian Perez <aperez>
Component: Tools / TestsAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=269190
https://bugs.webkit.org/show_bug.cgi?id=269350

Description Adrian Perez 2024-02-14 05:45:42 PST
There's a few like these:

   --- 8< ---

In file included from /app/webkit/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp:40:
/app/webkit/WebKitBuild/WPE/Release/Skia/Headers/skia/core/SkPixmap.h:419:16: error: cast from 'const char *' to 'const uint16_t *' (aka 'const unsigned short *') increases required alignment from 1 to 2 [-Werror,-Wcast-align]
        return (const uint16_t*)((const char*)this->addr16() + (size_t)y * fRowBytes + (x << 1));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/app/webkit/WebKitBuild/WPE/Release/Skia/Headers/skia/core/SkPixmap.h:437:16: error: cast from 'const char *' to 'const uint32_t *' (aka 'const unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
        return (const uint32_t*)((const char*)this->addr32() + (size_t)y * fRowBytes + (x << 2));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/app/webkit/WebKitBuild/WPE/Release/Skia/Headers/skia/core/SkPixmap.h:455:16: error: cast from 'const char *' to 'const uint64_t *' (aka 'const unsigned long *') increases required alignment from 1 to 8 [-Werror,-Wcast-align]
        return (const uint64_t*)((const char*)this->addr64() + (size_t)y * fRowBytes + (x << 3));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   --- 8< ---

These were introduced ion 274613@main and 274544@main
Comment 1 Adrian Perez 2024-02-14 05:51:42 PST
Pull request: https://github.com/WebKit/WebKit/pull/24411
Comment 2 EWS 2024-02-14 06:49:13 PST
Committed 274624@main (36d87a9c88b9): <https://commits.webkit.org/274624@main>

Reviewed commits have been landed. Closing PR #24411 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2024-02-14 06:50:14 PST
<rdar://problem/122946052>
Comment 4 Adrian Perez 2024-02-14 10:56:45 PST
Re-opening because GCC will complain about unknown pragmas due to
the -Wunknown-pragmas option :\
Comment 5 Adrian Perez 2024-02-14 11:09:48 PST
Pull request: https://github.com/WebKit/WebKit/pull/24434
Comment 6 EWS 2024-02-14 13:21:24 PST
Committed 274654@main (45d96da23f01): <https://commits.webkit.org/274654@main>

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