[Webkit-unassigned] [Bug 236014] New: [JSC] Remove compiler warning in TrailingArray.h

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 2 06:42:36 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236014

            Bug ID: 236014
           Summary: [JSC] Remove compiler warning in TrailingArray.h
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: xan.lopez at gmail.com

std::distance returns 'int' here, and we are comparing it with an unsigned int size. I believe we just care about the absolute value in the comparison, so use std::abs.

Warning:

WTF/Headers/wtf/TrailingArray.h: In instantiation of 'WTF::TrailingArray<Derived, T>::TrailingArray(unsigned int, InputIterator, InputIterator) [with InputIterator = const JSC::RegisterAtOffset*; Derived = WTF::EmbeddedFixedVector<JSC::RegisterAtOffset>; T = JSC::RegisterAtOffset]':
WTF/Headers/wtf/EmbeddedFixedVector.h:99:33:   required from 'WTF::EmbeddedFixedVector<T>::EmbeddedFixedVector(unsigned int, InputIterator, InputIterator) [with InputIterator = const JSC::RegisterAtOffset*; T = JSC::RegisterAtOffset]'
WTF/Headers/wtf/EmbeddedFixedVector.h:52:29:   required from 'static WTF::UniqueRef<WTF::EmbeddedFixedVector<T> > WTF::EmbeddedFixedVector<T>::create(InputIterator, InputIterator) [with InputIterator = const JSC::RegisterAtOffset*; T = JSC::RegisterAtOffset]'
WTF/Headers/wtf/EmbeddedFixedVector.h:72:22:   required from 'WTF::UniqueRef<WTF::EmbeddedFixedVector<T> > WTF::EmbeddedFixedVector<T>::clone() const [with T = JSC::RegisterAtOffset]'
WTF/Headers/wtf/FixedVector.h:43:61:   required from 'WTF::FixedVector< <template-parameter-1-1> >::FixedVector(const WTF::FixedVector< <template-parameter-1-1> >&) [with T = JSC::RegisterAtOffset]'
WTF/Headers/wtf/FixedVector.h:59:21:   required from 'WTF::FixedVector< <template-parameter-1-1> >& WTF::FixedVector< <template-parameter-1-1> >::operator=(const WTF::FixedVector< <template-parameter-1-1> >&) [with T = JSC::RegisterAtOffset]'
../../Source/JavaScriptCore/jit/RegisterAtOffsetList.h:37:7:   required from here
WTF/Headers/wtf/TrailingArray.h:69:43: warning: comparison of integer expressions of different signedness: 'std::iterator_traits<const JSC::RegisterAtOffset*>::difference_type' {aka 'int'} and 'unsigned int' [-Wsign-compare]
   69 |         ASSERT(std::distance(first, last) == size);
WTF/Headers/wtf/Assertions.h:356:11: note: in definition of macro 'ASSERT'
  356 |     if (!(assertion)) { \

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220202/6f8cb06b/attachment.htm>


More information about the webkit-unassigned mailing list