RESOLVED FIXED 174469
-Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
https://bugs.webkit.org/show_bug.cgi?id=174469
Summary -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
Michael Catanzaro
Reported 2017-07-13 11:22:21 PDT
This new warning from GCC 7 has found a problem in ComputedStyleExtractor::propertyValue: [2701/5861] Building CXX object Source.../css/CSSComputedStyleDeclaration.cpp.o ../../Source/WebCore/css/CSSComputedStyleDeclaration.cpp: In member function ‘WTF::RefPtr<WebCore::CSSValue> WebCore::ComputedStyleExtractor::propertyValue(WebCore::CSSPropertyID, WebCore::EUpdateLayout)’: ../../Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3344:13: warning: this statement may fall through [-Wimplicit-fallthrough=] } ^ ../../Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3345:9: note: here case CSSPropertyTextIndent: { ^~~~ Looking at the code, the fallthrough there appears to almost surely be undesired. But I have no clue how to fix it.
Attachments
Patch (1.60 KB, patch)
2017-08-07 12:28 PDT, Michael Catanzaro
no flags
Radar WebKit Bug Importer
Comment 1 2017-07-14 01:19:19 PDT
Michael Catanzaro
Comment 2 2017-08-07 10:15:45 PDT
Anyone know how to fix this one?
Simon Fraser (smfr)
Comment 3 2017-08-07 10:44:59 PDT
I don't think this is harmful. The switch in the previous block returns under every condition.
Michael Catanzaro
Comment 4 2017-08-07 12:25:52 PDT
Um, so it does. I'm surprised I missed that. Let's just silence the warning, then.
Michael Catanzaro
Comment 5 2017-08-07 12:28:14 PDT
Simon Fraser (smfr)
Comment 6 2017-08-07 13:20:32 PDT
Comment on attachment 317452 [details] Patch Or maybe just return nullptr?
Michael Catanzaro
Comment 7 2017-08-07 14:26:21 PDT
(In reply to Simon Fraser (smfr) from comment #6) > Comment on attachment 317452 [details] > Patch > > Or maybe just return nullptr? I assume that if we don't want that code to ever be hit, an assert is most appropriate?
Simon Fraser (smfr)
Comment 8 2017-08-07 14:31:56 PDT
Comment on attachment 317452 [details] Patch Sure, i guess.
WebKit Commit Bot
Comment 9 2017-08-07 15:01:29 PDT
Comment on attachment 317452 [details] Patch Clearing flags on attachment: 317452 Committed r220354: <http://trac.webkit.org/changeset/220354>
WebKit Commit Bot
Comment 10 2017-08-07 15:01:31 PDT
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.