Boost logo

Boost :

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


Hi,

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;
          switch(code){
          case xml_archive_parsing_error:
              msg = "unrecognized XML syntax";
              break;
          case xml_archive_tag_mismatch:
              msg = "XML start/end tag mismatch";
              break;
          default:
              archive_exception::what(); // (*)
          }
          return msg;
      }
 
   I think the compiler caught a genuine mistake and the line marked
   (*) should read

             msg = archive_exception::what();

Regards

Christoph

-- 
http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html
LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk