inconsistent names of args in basic_streambuf

  • karolszk

    karolszk - 2007-02-09


    I am trying to use a refactoring tool in my new Visual Slick Edit 11 and their parser
    notice the following problem in stl/_streambuf.c:

    stlport/stl/_streambuf.c(83,1): error -8076: 'xsputn' is not a member of 'basic_streambuf'

    It can't match the declaration in _streambuf.h:

    virtual streamsize xsputn(const char_type* __s, streamsize __n); // _streambuf.h:189

    beacuse of inconsistent argument lists of xsputn: in .h the first
    parameter is const char_type* but in .c is const _CharT*:

    basic_streambuf<_CharT, _Traits>::xsputn(const _CharT* __s, streamsize __n) //_streambuf.c:84

    of course in _streambuf.h is   typedef _CharT                     char_type;
    But why exist such a difference beetween header and .c file?

    Karol Szkudlarek

    • Petr Ovtchenkov

      Petr Ovtchenkov - 2007-02-09

      Well, may be this not very good style, but this is serious compiler bug indeed: typedef don't create new type.

    • Francois Dumont

      Francois Dumont - 2007-02-09

      IMO difference comes from portability. It is cleaner to have the Standard definitions in header but some compilers do not support (or wasn't supporting) use of nested types in methods implementation declaration, this is why _CharT is used at those points.

      You should perhaps report this problem to Visual Slick Edit developers as there is no ambiguity here, there is only one xsputn method in basic_streambuf. They could make their tool more flexible and perhaps only report a warning.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks