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.
<rdar://problem/120711320>
Pull request: https://github.com/WebKit/WebKit/pull/22550
> 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
Ah, usr/include/AvailabilityInternal.h is rewrites "macCatalyst" to "iosmac" in the internal SDK only. I've filed rdar://120799823 with more information.
(Re-posting <rdar://problem/120711320> to make the bug importer happy.)
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>