Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-12-09 06:04:02


> Not all of the warnings are benign. For example I get the following
> when compiling regex under vc8 with /analyze:
>
> 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' h:\source

That's a bug in [W]regerror: you won't hit it unless you're using the C
API's, but it's still very worrying, thanks for reporting that.

> 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

Borderline bug, I'll fix it anyway.

> 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

Ditto.

> h:\source code\boost\boost_1_33_1\libs\regex\src\posix_api.cpp(146) :
> warning C6200: Index '20' is out of valid index range '0' to '15' for
> non-stack buffer 'char const * * boost::`anonymous namespace'::names'
> h:\source code\boost\boost_1_33_1\libs\regex\src\posix_api.cpp(132) :
> warning C6385: Invalid data: accessing 'char const * *
> boost::`anonymous namespace'::names', the readable size is '64'
> bytes, but '84' bytes might be read: Lines: 126, 127, 129, 130, 132
> h:\source

Same bug as above, will fix.

> 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 h:\source

I can't see the issue there at all - and I've verified that the code is
fully covered by the test cases.

> 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 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':

Harmless, but it's worth fixing anyway.

> Lines: 565 Generally I have found these warnings to be right on with
> my own code. :-) While some of the warnings represent MS design
> decisions (e.g. deprecating certain SL functions), code analysis as a
> whole is very helpful and boost might benefit from it.

Yep, it would be worthwhile running one of our regression tests with these
turned on if any of our testers are able to do that. Is it possible to turn
analyse warnings into errors, without turning all the others into errors?

Thanks for the report.

John.


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