This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++: Problems with gslices (patch included)


Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de> writes:

| When running the following program tgs compiled by g++-20010125 on
| i686-pc-linux-gnu 

[...]

| incorrect output is obtained.
| ./tgs
| abcdefghijklmnop
| ABCDEF
| abcAeCBEDjFlmnop
| abcdefghijklmnop
| dgfihkjmlon
| cfilo
| 
| Closer examination shows that the arguments of len and str in the 
| gslice implementation seem to be reversed.

Your analysis is correct,
  from gslice.h:

    inline
    gslice::gslice(size_t __o, const valarray<size_t>& __l,
                   const valarray<size_t>& __s)
            : _M_index(new gslice::_Indexer(__o, __l, __s)) {}


  from valarray-inst.cc:

    gslice::_Indexer::_Indexer(size_t __o, const valarray<size_t>& __s,
                               const valarray<size_t>& __l)

which clearly shows that the arguments were reversed in the last
case. 

Thanks for your feedback.  Fixed with fortcoming patch.

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]