Compiling the following code snippet with "g++ -m32 -S -Wall -O2 t.cc" on a 64bit machine issues a warning t.cc: In static member function 'static void NewDelFunctionsT<T>::deleteArray_T(void*) [with T = EcalTPGLut]': t.cc:12: warning: array subscript is below array bounds This does not happen with 4.4. t.cc: class EcalTPGLut { public: ~EcalTPGLut() ; private: unsigned int lut_[1024]; }; template <class T> struct NewDelFunctionsT { static void deleteArray_T(void* p) { delete[] (T*) p; } }; typedef void (*DelArrFunc_t)(void*); DelArrFunc_t method_newdel_98() { return NewDelFunctionsT< ::EcalTPGLut >::deleteArray_T; }
Ditto here on powerpc64-unknown-linux-gnu. -m32 gives the warning, -m64 does not.
I'm afraid it's highly unlikely that this will be fixed in 4_3-branch... To the best of my knowledge, fixing it involved a few rather invasive patches and the branch is close to its end of life...
OK, I didn't know that the branch is closed, nor that it involves extensive changes. Sorry it took me so long to find this! I can of course use #pragma GCC diagnostic ignored "-Warray-bounds" if needed.
This is FIXED in GCC 4.4. There may be a 4.3.4 release but this is not a regression and nobody seems interested in investigating whether it can be fixed with a minimal patch. So I am closing it as FIXED. If you can reproduce it with GCC 4.5, please reopen.