[serialization] warnings while building Boost.Serialization

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

On Tue, Oct 19, 2004 at 10:57:18AM +0200, Christoph Ludwig wrote:
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.
And one more: In collection_traits.hpp, line 51, the line || (ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615) triggers the warning "integer constant is so large that it is unsigned". I think the last literal should be an unsigned literal, i.e. || (ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) ^^^ Regards Christoph -- http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html
participants (1)
-
Christoph Ludwig