Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#4095 closed Bugs (wontfix)

array subscript is above array bounds warning

Reported by: tfogal at sci -- utah.edu Owned by: Gennadiy Rozental
Milestone: Boost 1.43.0 Component: test
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

I am seeing this warning while running ../bjam from within the tools directory:

gcc.compile.c++ ../bin.v2/libs/test/build/gcc-4.3.2/release/link-static/debug.o
In file included from ../libs/test/src/debug.cpp:16: /usr/include/c++/4.3/bits/stl_algo.h: In function `char* boost::debug::<unnamed>::prepare_window_title(const boost::debug::dbg_startup_info&)':
/usr/include/c++/4.3/bits/stl_algo.h:190: warning: array subscript is above array bounds

I would normally ignore such things, as it's "just a warning".. but this seems like the kind of warning which should really be an error.

Replace the "--" with a dot in my email, of course.

Change History (2)

comment:1 by Steven Watanabe, 13 years ago

Resolution: wontfix
Status: newclosed

This is a spurious warning caused by loop unrolling in std::find. There's nothing we can do about it.

comment:2 by anonymous, 11 years ago

Possible workaround if you're stuck with a broken compiler:

$ diff -u boost_1_47_0/boost/test/impl/debug.ipp install_1_47_0/include/boost/test/impl/debug.ipp 
--- boost_1_47_0/boost/test/impl/debug.ipp	2011-10-06 17:00:22.102991319 -0400
+++ install_1_47_0/include/boost/test/impl/debug.ipp	2011-10-06 17:00:14.483359431 -0400
@@ -307,7 +307,8 @@
 
     static char title_str[50];
 
-    str_t path_sep( "\\/" );
+    //str_t path_sep( "\\/" );
+    const std::string path_sep( "\\/" );
 
     str_t::iterator  it = unit_test::find_last_of( dsi.binary_path.begin(), dsi.binary_path.end(),
                                                    path_sep.begin(), path_sep.end() );
Note: See TracTickets for help on using tickets.