Bug 215269 - [WTF] Remove the build warning since r265344.
Summary: [WTF] Remove the build warning since r265344.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joonghun Park
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-07 07:45 PDT by Joonghun Park
Modified: 2020-08-08 03:55 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.89 KB, patch)
2020-08-07 07:47 PDT, Joonghun Park
no flags Details | Formatted Diff | Diff
Patch (1.61 KB, patch)
2020-08-07 18:21 PDT, Joonghun Park
no flags Details | Formatted Diff | Diff
Patch (1.61 KB, patch)
2020-08-07 18:24 PDT, Joonghun Park
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joonghun Park 2020-08-07 07:45:40 PDT
In file included from DerivedSources/ForwardingHeaders/wtf/text/AtomString.h:26,
                 from DerivedSources/ForwardingHeaders/wtf/text/StringBuilder.h:30,
                 from ../../Tools/TestWebKitAPI/WTFStringUtilities.h:39,
                 from ../../Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:28:
DerivedSources/ForwardingHeaders/wtf/text/IntegerToStringConversion.h: In instantiation of ‘unsigned int WTF::lengthOfIntegerAsString(IntegerType) [with IntegerType = bool]’:
DerivedSources/ForwardingHeaders/wtf/text/StringConcatenateNumbers.h:60:61:   required from ‘unsigned int WTF::StringTypeAdapter<Enum, typename std::enable_if<is_enum_v<Enum>, void>::type>::length() const [with Enum = TestWebKitAPI::BoolEnum; typename std::enable_if<is_enum_v<Enum>, void>::type = void]’
DerivedSources/ForwardingHeaders/wtf/text/StringConcatenate.h:390:35:   required from ‘WTF::String WTF::tryMakeStringFromAdapters(StringTypeAdapter, StringTypeAdapters ...) [with StringTypeAdapter = WTF::StringTypeAdapter<TestWebKitAPI::BoolEnum, void>; StringTypeAdapters = {}]’
DerivedSources/ForwardingHeaders/wtf/text/StringConcatenate.h:420:37:   required from ‘WTF::String WTF::tryMakeString(StringTypes ...) [with StringTypes = {TestWebKitAPI::BoolEnum}]’
DerivedSources/ForwardingHeaders/wtf/text/StringConcatenate.h:426:34:   required from ‘WTF::String WTF::makeString(StringTypes ...) [with StringTypes = {TestWebKitAPI::BoolEnum}]’
../../Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:111:5:   required from here
DerivedSources/ForwardingHeaders/wtf/text/IntegerToStringConversion.h:115:53: warning: parameter ‘integer’ set but not used [-Wunused-but-set-parameter]
  115 | inline unsigned lengthOfIntegerAsString(IntegerType integer)
      |                                         ~~~~~~~~~~~~^~~~~~~
Comment 1 Joonghun Park 2020-08-07 07:47:47 PDT
Created attachment 406174 [details]
Patch
Comment 2 David Kilzer (:ddkilzer) 2020-08-07 16:00:52 PDT
Comment on attachment 406174 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406174&action=review

Both lengthOfIntegerAsString() and another method were refactored to handle all types in a single method, so I'd prefer to keep them that way.

> Source/WTF/wtf/text/IntegerToStringConversion.h:-119
> -    if constexpr (std::is_same_v<IntegerType, bool>)
> -        return 1;

I think we should add UNUSED_PARAM(integer) here instead.
Comment 3 Joonghun Park 2020-08-07 17:42:37 PDT
(In reply to David Kilzer (:ddkilzer) from comment #2)
> Comment on attachment 406174 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=406174&action=review
> 
> Both lengthOfIntegerAsString() and another method were refactored to handle
> all types in a single method, so I'd prefer to keep them that way.
> 
> > Source/WTF/wtf/text/IntegerToStringConversion.h:-119
> > -    if constexpr (std::is_same_v<IntegerType, bool>)
> > -        return 1;
> 
> I think we should add UNUSED_PARAM(integer) here instead.

Thank you for your review. I will add UNUSED_PARAM in the next patchset.
Comment 4 Joonghun Park 2020-08-07 18:21:53 PDT
Created attachment 406237 [details]
Patch
Comment 5 Joonghun Park 2020-08-07 18:24:43 PDT
Created attachment 406239 [details]
Patch
Comment 6 Joonghun Park 2020-08-08 03:54:06 PDT
Committed r265407: <https://trac.webkit.org/changeset/265407>
Comment 7 Radar WebKit Bug Importer 2020-08-08 03:55:18 PDT
<rdar://problem/66721962>