WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
208060
Warning spam from ResourceLoaderOptions.h (Bots need updating to compiler without this issue)
https://bugs.webkit.org/show_bug.cgi?id=208060
Summary
Warning spam from ResourceLoaderOptions.h (Bots need updating to compiler wit...
Michael Catanzaro
Reported
2020-02-21 09:17:51 PST
/home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:205:24: warning: ‘WebCore::ResourceLoaderOptions::sendLoadCallbacks’ is too small to hold all values of ‘enum class WebCore::SendCallbackPolicy’ 205 | SendCallbackPolicy sendLoadCallbacks : bitWidthOfSendCallbackPolicy; | ^~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:206:27: warning: ‘WebCore::ResourceLoaderOptions::sniffContent’ is too small to hold all values of ‘enum class WebCore::ContentSniffingPolicy’ 206 | ContentSniffingPolicy sniffContent : bitWidthOfContentSniffingPolicy; | ^~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:207:35: warning: ‘WebCore::ResourceLoaderOptions::sniffContentEncoding’ is too small to hold all values of ‘enum class WebCore::ContentEncodingSniffingPolicy’ 207 | ContentEncodingSniffingPolicy sniffContentEncoding : bitWidthOfContentEncodingSniffingPolicy; | ^~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:208:25: warning: ‘WebCore::ResourceLoaderOptions::dataBufferingPolicy’ is too small to hold all values of ‘enum class WebCore::DataBufferingPolicy’ 208 | DataBufferingPolicy dataBufferingPolicy : bitWidthOfDataBufferingPolicy; | ^~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:209:29: warning: ‘WebCore::ResourceLoaderOptions::storedCredentialsPolicy’ is too small to hold all values of ‘enum class WebCore::StoredCredentialsPolicy’ 209 | StoredCredentialsPolicy storedCredentialsPolicy : bitWidthOfStoredCredentialsPolicy; | ^~~~~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:210:25: warning: ‘WebCore::ResourceLoaderOptions::securityCheck’ is too small to hold all values of ‘enum class WebCore::SecurityCheckPolicy’ 210 | SecurityCheckPolicy securityCheck : bitWidthOfSecurityCheckPolicy; | ^~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:211:27: warning: ‘WebCore::ResourceLoaderOptions::certificateInfoPolicy’ is too small to hold all values of ‘enum class WebCore::CertificateInfoPolicy’ 211 | CertificateInfoPolicy certificateInfoPolicy : bitWidthOfCertificateInfoPolicy; | ^~~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:212:37: warning: ‘WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition’ is too small to hold all values of ‘enum class WebCore::ContentSecurityPolicyImposition’ 212 | ContentSecurityPolicyImposition contentSecurityPolicyImposition : bitWidthOfContentSecurityPolicyImposition; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:213:25: warning: ‘WebCore::ResourceLoaderOptions::defersLoadingPolicy’ is too small to hold all values of ‘enum class WebCore::DefersLoadingPolicy’ 213 | DefersLoadingPolicy defersLoadingPolicy : bitWidthOfDefersLoadingPolicy; | ^~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:214:19: warning: ‘WebCore::ResourceLoaderOptions::cachingPolicy’ is too small to hold all values of ‘enum class WebCore::CachingPolicy’ 214 | CachingPolicy cachingPolicy : bitWidthOfCachingPolicy; | ^~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:215:27: warning: ‘WebCore::ResourceLoaderOptions::sameOriginDataURLFlag’ is too small to hold all values of ‘enum class WebCore::SameOriginDataURLFlag’ 215 | SameOriginDataURLFlag sameOriginDataURLFlag : bitWidthOfSameOriginDataURLFlag; | ^~~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:216:22: warning: ‘WebCore::ResourceLoaderOptions::initiatorContext’ is too small to hold all values of ‘enum class WebCore::InitiatorContext’ 216 | InitiatorContext initiatorContext : bitWidthOfInitiatorContext; | ^~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:217:24: warning: ‘WebCore::ResourceLoaderOptions::serviceWorkersMode’ is too small to hold all values of ‘enum class WebCore::ServiceWorkersMode’ 217 | ServiceWorkersMode serviceWorkersMode : bitWidthOfServiceWorkersMode; | ^~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:218:26: warning: ‘WebCore::ResourceLoaderOptions::applicationCacheMode’ is too small to hold all values of ‘enum class WebCore::ApplicationCacheMode’ 218 | ApplicationCacheMode applicationCacheMode : bitWidthOfApplicationCacheMode; | ^~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:219:28: warning: ‘WebCore::ResourceLoaderOptions::clientCredentialPolicy’ is too small to hold all values of ‘enum class WebCore::ClientCredentialPolicy’ 219 | ClientCredentialPolicy clientCredentialPolicy : bitWidthOfClientCredentialPolicy; | ^~~~~~~~~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:220:21: warning: ‘WebCore::ResourceLoaderOptions::preflightPolicy’ is too small to hold all values of ‘enum class WebCore::PreflightPolicy’ 220 | PreflightPolicy preflightPolicy : bitWidthOfPreflightPolicy; | ^~~~~~~~~~~~~~~ /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/ResourceLoaderOptions.h:221:28: warning: ‘WebCore::ResourceLoaderOptions::loadedFromOpaqueSource’ is too small to hold all values of ‘enum class WebCore::LoadedFromOpaqueSource’ 221 | LoadedFromOpaqueSource loadedFromOpaqueSource : bitWidthOfLoadedFromOpaqueSource; | ^~~~~~~~~~~~~~~~~~~~~~
Attachments
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2020-02-21 09:37:02 PST
Yusuke, I think we just need to roll out
r256482
? Or switch from using enum classes to integer constants? GCC really doesn't like this. It doesn't even have a name for this warning, so it can't be disabled afaik.
Yusuke Suzuki
Comment 2
2020-02-29 01:25:32 PST
(In reply to Michael Catanzaro from
comment #1
)
> Yusuke, I think we just need to roll out
r256482
? Or switch from using enum > classes to integer constants? GCC really doesn't like this. It doesn't even > have a name for this warning, so it can't be disabled afaik.
Can we disable this warning on GCC? Using `unsigned` looks like worse than using enum.
Michael Catanzaro
Comment 3
2020-02-29 08:14:25 PST
(In reply to Yusuke Suzuki from
comment #2
)
> Can we disable this warning on GCC? Using `unsigned` looks like worse than > using enum.
I don't think so. Because the warning doesn't have a name (like, say, -Wsign-compare), there's no way to pass a build flag to disable it or to suppress it using a #pragma. If think if we really want to use bitfields here, then we need to change these to no longer use enums.
Eike Rathke
Comment 4
2020-02-29 08:36:44 PST
You might be interested in how LibreOffice handles this:
https://opengrok.libreoffice.org/xref/core/include/o3tl/typed_flags_set.hxx?r=b612cf0e
as used for example
https://opengrok.libreoffice.org/xref/core/vcl/inc/salptype.hxx?r=b4c6ac33#27
Yusuke Suzuki
Comment 5
2020-02-29 12:56:15 PST
(In reply to Michael Catanzaro from
comment #3
)
> (In reply to Yusuke Suzuki from
comment #2
) > > Can we disable this warning on GCC? Using `unsigned` looks like worse than > > using enum. > > I don't think so. Because the warning doesn't have a name (like, say, > -Wsign-compare), there's no way to pass a build flag to disable it or to > suppress it using a #pragma. If think if we really want to use bitfields > here, then we need to change these to no longer use enums.
We really want. So unsigned is only the answer. I cannot understand why GCC is emitting such a warning without flags, clang does mot emit it :(
Darin Adler
Comment 6
2020-03-01 11:29:13 PST
It’s amazing that we can actually use enums with bit fields in other compilers. I’m sorry to hear that gcc is holding us back. We wanted this for years!
Michael Catanzaro
Comment 7
2020-03-02 07:10:19 PST
Well the warning makes sense to me. We have a clear declared width for the enum and are trying to stuff it into a field that is too small to hold it. Maybe the warning would go away if we remove the width...? I'll try.
Michael Catanzaro
Comment 8
2020-03-02 07:24:05 PST
(In reply to Michael Catanzaro from
comment #7
)
> Maybe the warning would go away if we remove the width...? I'll try.
Nope. Was worth a try....
Michael Catanzaro
Comment 9
2020-03-02 14:21:10 PST
So Phil found:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414
. Good job, Phil! It's fixed in GCC 8.4+, 9.3+, and 10. I'm testing with the GCC 10.0.1 Feb 16 snapshot that we have in Fedora 32, and the warnings are indeed gone, so I'm going to close this.
Yusuke Suzuki
Comment 10
2020-03-04 14:14:54 PST
(In reply to Michael Catanzaro from
comment #9
)
> So Phil found:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414
. Good job, > Phil! It's fixed in GCC 8.4+, 9.3+, and 10. > > I'm testing with the GCC 10.0.1 Feb 16 snapshot that we have in Fedora 32, > and the warnings are indeed gone, so I'm going to close this.
That sounds really nice!
Alberto Garcia
Comment 11
2020-03-10 07:35:13 PDT
I understand that this warning is a false positive? In other words, is the code built with the affected GCC versions safe to use?
Michael Catanzaro
Comment 12
2020-03-10 07:49:25 PDT
I assume it's a false-positive, yes.
Brady Eidson
Comment 13
2020-04-19 10:17:37 PDT
(In reply to Michael Catanzaro from
comment #9
)
> So Phil found:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414
. Good job, > Phil! It's fixed in GCC 8.4+, 9.3+, and 10. > > I'm testing with the GCC 10.0.1 Feb 16 snapshot that we have in Fedora 32, > and the warnings are indeed gone, so I'm going to close this.
But.... our EWS bots are still showing the warning. Thousands of times per build. So there's still an issue in the WebKit Open Source project. Who's task is it to update the bots to newer GCC or clang?
Michael Catanzaro
Comment 14
2020-05-10 13:07:55 PDT
(In reply to Brady Eidson from
comment #13
)
> Who's task is it to update the bots to newer GCC or clang?
Nobody responded to this? I highly doubt the bots will be updated to a newer GCC. If avoiding warnings on the bots is desired, we'll have to suppress them by either changing WebKit's code or build system.
Darin Adler
Comment 15
2020-05-10 13:46:45 PDT
The bots will *never* be updated? That can’t be right. When would they normally be updated if there was no GCC bug motivating us? Separately, we should make the EWS system filter out these warnings as a stopgap measure.
Michael Catanzaro
Comment 16
2020-05-10 14:47:48 PDT
I think they're updated for new Debian releases (every 2-3 years).
Darin Adler
Comment 17
2020-05-10 15:16:25 PDT
Does someone know when the next Debian release is coming?
Michael Catanzaro
Comment 18
2020-05-10 15:51:38 PDT
Guess: 1-2 more years. Anyway, better wait for someone who actually runs the bots to respond.
Philippe Normand
Comment 19
2020-05-11 00:41:07 PDT
The bots using the Flatpak SDK build with GCC 9.3.0. Only Adrian's EWS is left to migrate, AFAIK...
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug