Bug 267973
| Summary: | Add -Wno-elaborated-enum-base 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 FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=267269 https://bugs.webkit.org/show_bug.cgi?id=279837 |
||
David Kilzer (:ddkilzer)
Add -Wno-elaborated-enum-base to WARNING_FLAGS when building with clang static analyzer.
The clang static analyzer from open source clang-17 complains about how the `CF_ENUM()` macro is defined in `CFAvailability.h`, so we have to disable this warning for now.
The internal fix to `CFAvailability.h` is tracked by <rdar://121475724>.
Example:
In file included from OpenSource/Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:27:
In file included from WebKitBuild/Debug/usr/local/include/wtf/text/TextBreakIterator.h:32:
In file included from WebKitBuild/Debug/usr/local/include/wtf/text/cf/TextBreakIteratorCF.h:23:
In file included from WebKitBuild/Debug/usr/local/include/wtf/text/cf/TextBreakIteratorCFCharacterCluster.h:24:
WebKitBuild/Debug/usr/local/include/wtf/spi/cf/CFStringSPI.h:39:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
39 | typedef CF_ENUM(CFIndex, CFStringCharacterClusterType)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from OpenSource/Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:25:
In file included from OpenSource/Source/WTF/wtf/RetainPtr.h:33:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:54:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:21:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:178:55: note: expanded from macro 'CF_ENUM'
178 | #define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:143:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
143 | #define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:151:75: note: expanded from macro '__CF_NAMED_ENUM'
151 | #define __CF_NAMED_ENUM(_type, _name) enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
| ^~~~~~~
1 error generated.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/121479931>
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/23142
EWS
Committed 273435@main (a4903bd869a6): <https://commits.webkit.org/273435@main>
Reviewed commits have been landed. Closing PR #23142 and removing active labels.