Bug 169243

Summary: Fix -Wattributes warning spam
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKit2Assignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, benjamin, cdumez, cmarcelo, commit-queue, darin, dbates, mcatanzaro, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch
none
Patch none

Michael Catanzaro
Reported 2017-03-06 18:41:26 PST
-Wattributes warning spam caused by r213198: ../../Source/WebKit2/UIProcess/API/C/WKPageGroup.h:55:102: warning: ‘unavailable’ attribute directive ignored [-Wattributes] WK_EXPORT WKStringRef WKPageGroupCopyIdentifier(WKPageGroupRef pageGroup) __attribute__((unavailable)); ^ ../../Source/WebKit2/UIProcess/API/C/WKPageGroup.h:56:143: warning: ‘unavailable’ attribute directive ignored [-Wattributes] WK_EXPORT void WKPageGroupAddUserContentFilter(WKPageGroupRef pageGroup, WKUserContentFilterRef userContentFilter) __attribute__((unavailable)); ^ ../../Source/WebKit2/UIProcess/API/C/WKPageGroup.h:57:139: warning: ‘unavailable’ attribute directive ignored [-Wattributes] WK_EXPORT void WKPageGroupRemoveUserContentFilter(WKPageGroupRef pageGroup, WKStringRef userContentFilterName) __attribute__((unavailable)); It prints hundreds of times, since it's in a header file.
Attachments
Patch (3.74 KB, patch)
2017-03-06 18:43 PST, Michael Catanzaro
no flags
Patch (2.83 KB, patch)
2017-03-07 12:43 PST, Michael Catanzaro
no flags
Michael Catanzaro
Comment 1 2017-03-06 18:43:47 PST
mitz
Comment 2 2017-03-06 18:59:23 PST
Comment on attachment 303600 [details] Patch Don’t import wtf headers from WebKit2 framework headers. Instead, you can define WK_UNAVAILABLE in WKDeclarationSpecifiers.h.
Michael Catanzaro
Comment 3 2017-03-06 19:36:28 PST
(In reply to comment #2) > Comment on attachment 303600 [details] > Patch > > Don’t import wtf headers from WebKit2 framework headers. Umm yeah, that was dumb, oops.
Alexey Proskuryakov
Comment 4 2017-03-06 22:32:40 PST
This failure is surprising, given that NS_UNAVAILAbLE is defined in macOS like this: /* * only certain compilers support __attribute__((unavailable)) */ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable)) #else #define UNAVAILABLE_ATTRIBUTE #endif #if !defined(NS_UNAVAILABLE) #define NS_UNAVAILABLE UNAVAILABLE_ATTRIBUTE #endif
Michael Catanzaro
Comment 5 2017-03-07 07:02:26 PST
Weird. I have absolutely no clue; maybe it used to exist but was removed (very unlikely), maybe Apple has its own fork of GCC where it added that attribute (seems unlikely too), maybe you don't care about GCC and the check is really just there for Clang (also seems unlikely)... I don't know! It's not documented anywhere and it definitely does not work.
Michael Catanzaro
Comment 6 2017-03-07 12:43:46 PST
Michael Catanzaro
Comment 7 2017-03-07 12:44:40 PST
Let's see if EWS likes this. Note: __has_extension is guaranteed to be defined where I removed the check for it; that's a drive-by cleanup.
Michael Catanzaro
Comment 8 2017-03-08 18:05:35 PST
Comment on attachment 303703 [details] Patch Thanks!
WebKit Commit Bot
Comment 9 2017-03-08 18:40:58 PST
Comment on attachment 303703 [details] Patch Clearing flags on attachment: 303703 Committed r213620: <http://trac.webkit.org/changeset/213620>
WebKit Commit Bot
Comment 10 2017-03-08 18:41:04 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.