Boost logo

Boost :

From: Christoph Ludwig (cludwig_at_[hidden])
Date: 2004-10-19 03:57:18


when building Boost.Serialization my compiler (gcc 3.4.2 on
i686-pc-linux-gnu) issues some warnings. They are no big deal for me,
but I think they can (and should) easiliy be avoided.

 * In wchar_from_mb.hpp, line 107, we have

     for(int i = 0; i++ < MB_CUR_MAX;){ //...

   On my system, MB_CUR_MAX evaluates to an expression of type size_t,
   whence the compiler warns about a comparison between signed and
   unsigned. I don't know which type MB_CUR_MAX is supposed to have
   according to the relevant standards, but I think it is safe to
   assume that the value of MB_CUR_MAX will always fit into a signed
   int. I therefore propose to change above line into:

     for(int i = 0; i++ < int(MB_CUR_MAX);){ //...

 * In basic_xml_archive, line 38, I get a warning about a potentially
   uninitialized variable msg:

      virtual const char *what( ) const throw( )
          const char *msg;
          case xml_archive_parsing_error:
              msg = "unrecognized XML syntax";
          case xml_archive_tag_mismatch:
              msg = "XML start/end tag mismatch";
              archive_exception::what(); // (*)
          return msg;
   I think the compiler caught a genuine mistake and the line marked
   (*) should read

             msg = archive_exception::what();




Boost list run by bdawes at, gregod at, cpdaniel at, john at