RESOLVED FIXED 162551
-Wtautological-compare triggered in URLParser::internalValuesConsistent
https://bugs.webkit.org/show_bug.cgi?id=162551
Summary -Wtautological-compare triggered in URLParser::internalValuesConsistent
Michael Catanzaro
Reported 2016-09-26 01:48:55 PDT
This is wrong: [3876/6045] Building CXX object Source...s/WebCore.dir/platform/URLParser.cpp.o ../../Source/WebCore/platform/URLParser.cpp: In static member function ‘static bool WebCore::URLParser::internalValuesConsistent(const WebCore::URL&)’: ../../Source/WebCore/platform/URLParser.cpp:2357:26: warning: self-comparison always evaluates to true [-Wtautological-compare] && url.m_hostEnd <= url.m_hostEnd ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
Attachments
Patch (1.45 KB, patch)
2016-09-26 01:52 PDT, Michael Catanzaro
no flags
Michael Catanzaro
Comment 1 2016-09-26 01:52:05 PDT
Alexey Proskuryakov
Comment 2 2016-09-26 07:44:26 PDT
Can a regression test detect this? Also, can this warning be enabled in normal build?
Alex Christensen
Comment 3 2016-09-26 08:18:26 PDT
Comment on attachment 289810 [details] Patch We shouldn't be able to add a regression test for this because both inequalities should always be true. If either one can be false, there is a major error in the parser. There are a few such cases right now, but when I'm finished soon there won't be. We should enable the warning somewhere, if not everywhere.
Michael Catanzaro
Comment 4 2016-09-26 11:49:06 PDT
Comment on attachment 289810 [details] Patch With GCC it's enabled by -Wall, which is set in CMake ports by WEBKIT_SET_EXTRA_COMPILER_FLAGS, which *hopefully* is used on all targets. Definitely seems like a good idea to set it in Xcode builds as well, but you'll forgive me if I don't assist with that. ;)
WebKit Commit Bot
Comment 5 2016-09-26 12:11:22 PDT
Comment on attachment 289810 [details] Patch Clearing flags on attachment: 289810 Committed r206385: <http://trac.webkit.org/changeset/206385>
WebKit Commit Bot
Comment 6 2016-09-26 12:11:26 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.