Bug 267269
| Summary: | Add -Wno-availability to WARNING_FLAGS when building with clang static analyzer | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | Tools / Tests | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | emw, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=267973 | ||
David Kilzer (:ddkilzer)
Add -Wno-availability to WARNING_FLAGS when building with clang static analyzer.
The clang static analyzer from open source clang-17 doesn't know about the iosmac platform, so we get a stream of warnings-as-errors with -Wavailability checks.
Example:
WebKitBuild/Release/usr/local/include/pal/spi/cocoa/AVFoundationSPI.h:440:94: error: unknown platform 'iosmac' in availability macro [-Werror,-Wavailability]
440 | - (instancetype)initWithAssumedIdentity:(tcc_identity_t)tccIdentity SPI_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, macCatalyst, watchos, tvos);
| ^
In file included from Source/WebCore/PAL/pal/avfoundation/OutputDevice.mm:26:
In file included from Source/WebCore/PAL/config.h:36:
In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26:
In file included from WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:34:
In file included from WebKitBuild/Release/usr/local/include/wtf/Assertions.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.Internal.sdk/usr/include/os/log.h:11:
/Applications/Xcode2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.Internal.sdk/usr/include/os/availability.h:154:169: note: expanded from macro 'API_UNAVAILABLE'
154 | #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE8,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
| ^
1 error generated.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/120711320>
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/22550
Elliott Williams
> WebKitBuild/Release/usr/local/include/pal/spi/cocoa/AVFoundationSPI.h:440:94: error: unknown platform 'iosmac' in availability macro [-Werror,-Wavailability]
> 440 | - (instancetype)initWithAssumedIdentity:(tcc_identity_t)tccIdentity SPI_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, macCatalyst, watchos, tvos);
> | ^
It's weird that this is complaining about "iosmac" when the declaration says "macCatalyst".
Upstream clang does appear to know about "maccatalyst": https://github.com/llvm/llvm-project/blob/a1dc813f759955ddbcf9b12ed052dfc8a07fdf4a/clang/include/clang/Basic/Attr.td#L974C29-L974C29
Elliott Williams
Ah, usr/include/AvailabilityInternal.h is rewrites "macCatalyst" to "iosmac" in the internal SDK only. I've filed rdar://120799823 with more information.
Elliott Williams
(Re-posting <rdar://problem/120711320> to make the bug importer happy.)
David Kilzer (:ddkilzer)
Not going to land this fix. See the PR for details (this is not a supported configuration):
<https://github.com/WebKit/WebKit/pull/22550#issuecomment-1886077808>