Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-12-11 05:56:44


This is mainly for the benefit of Google, but here's the full run-down on
the /analyse warnings and their fixes:

h:\source code\boost\boost_1_33_1\libs\regex\src\wide_posix_api.cpp(159) :
warning C6200: Index '20' is out of valid index range '0' to '15' for
non-stack buffer 'wchar_t const * * boost::`anonymous namespace'::wnames'

It's a bug, it only strikes if you use regerr with the flags REG_ITOA or
REG_ATOI set: these are debugging helpers added for compatibility with the
BSD regex package, POSIX conforming code is not effected. The bug appears
to have been present for several releases without anyone reporting it, so
maybe I should have just removed that code (!), however fixes and enhanced
test cases are in the diffs below. Frankly this one is embarrassing.

h:\source
code\boost\boost_1_33_1\boost\regex\v4\basic_regex_creator.hpp(1183) :
warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to
64-bit value. Results might not be an expected value

Another bug, but only strikes in certain rare situations when you have more
than 32 repetition operators in the expression (that's not the only
requirement though). Test cases and fix in the diffs below.

h:\source
code\boost\boost_1_33_1\boost\regex\v4\basic_regex_creator.hpp(1203) :
warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to
64-bit value. Results might not be an expected value

As above.

h:\source code\boost\boost_1_33_1\boost\regex\v4\w32_regex_traits.hpp(537) :
warning C6385: Invalid data: accessing 'unsigned long const * const
`private: unsigned long __thiscall
boost::re_detail::w32_regex_traits_implementation<char>::lookup_classname_imp(char
const *,char const *)const '::`2'::masks', the readable size is '80' bytes,
but '84' bytes might be read: Lines: 505, 528, 530, 531, 532, 535, 536, 537

I can't understand this one, in fact I'm certain it's not a bug :-)

George: if you add an extra 0 to the data-array does that suppress the
warning, or just shift it? I have a suspicion the analyser is getting
confused by the +1 added to the index (this is correct the original value is
in the range [-1, max-1), so does need to be shifted by one).

h:\source
code\boost\boost_1_33_1\boost\regex\v4\basic_regex_creator.hpp(576) :
warning C6246: Local declaration of 'c3' hides declaration of the same name
in outer scope. For additional information, see previous declaration at line
'565' of 'h:\source
code\boost\boost_1_33_1\boost\regex\v4\basic_regex_creator.hpp': Lines: 565

Basically harmless, but fixed anyway.

HTH, John.




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