Coverity complains "Big parameter passed by value" in /usr/include/c++/4.6/bits/stl_heap.h

Marc Glisse marc.glisse@inria.fr
Thu Jul 25 06:16:00 GMT 2013


On Wed, 24 Jul 2013, Dan Kegel wrote:

> (I don't see libstdc++ listed at http://scan.coverity.com/projects,
> but I do see gcc there,
> so perhaps someone has already handling coverity warnings.)
>
> I'm using Coverity on a project built with gcc-4.6.3 (Ubuntu's version).
> It recently issued a complaint about /usr/include/c++/4.6/bits/stl_heap.h:
>
> 170      _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
> 171      std::__push_heap(__first, _DistanceType((__last - __first) - 1),
> 172                       _DistanceType(0), _GLIBCXX_MOVE(__value));
> 173    }
> 174
> 175  template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
> 176           typename _Compare>
> 177    void
> 178    __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
>
> CID 10892: Big parameter passed by value (PASS_BY_VALUE)
> pass_by_value: Passing parameter __value of type Request (size 160
> bytes) by value.
> 179                _Distance __topIndex, _Tp __value, _Compare __comp)
>
> ...
>
> 294  template<typename _RandomAccessIterator, typename _Distance,
> 295           typename _Tp, typename _Compare>
> 296    void
> 297    __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
>
> CID 10893: Big parameter passed by value (PASS_BY_VALUE)
> pass_by_value: Passing parameter __value of type Request (size 160
> bytes) by value.
> 298                  _Distance __len, _Tp __value, _Compare __comp)
>
> I'm tempted to just ignore it, but I can provide more details if
> anyone's interested.

Isn't it this PR?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51965

-- 
Marc Glisse



More information about the Libstdc++ mailing list