[SOLVED] Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-20 Thread julien2412
Thank you Stephan, I didn't know this. (about the loop, sorry for mystupid confusion! :-)) -- View this message in context: http://nabble.documentfoundation.org/cppcheck-arrayIndexOutOfBounds-report-in-stortree-cxx-store-module-tp4136432p4136757.html Sent from the Dev mailing list archive at

Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-20 Thread Stephan Bergmann
On 01/19/2015 10:52 PM, julien2412 wrote: However, I'm not sure to understand. I mean, I thought there were mere array (like in C) with fixed size and vector or other dynamic containers. The idea is to allocate only a single block of memory for the fixed-size "head" of the struct plus the dyna

Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-19 Thread julien2412
sberg wrote > ... > That m_pData is a "flexible array member" whose actual length is > controlled dynamically. Cppcheck could probably make use of a heuristic > to treat a trailing member declared as an array of length 1 as such a > flexible array, as do some other static analysis tools. Thank

Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-19 Thread Stephan Bergmann
On 01/17/2015 03:49 PM, julien2412 wrote: Cppcheck reported this: 41 OStoreBTreeNodeData::OStoreBTreeNodeData (sal_uInt16 nPageSize) 42 : OStorePageData (nPageSize) 43 { 44 base::m_aGuard.m_nMagic = store::htonl(self::theTypeId); 45 base::m_aDescr.

Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-17 Thread Maarten Hoes
On Sat, Jan 17, 2015 at 6:57 PM, Julien Nabet wrote: > > On 17/01/2015 16:03, Maarten Hoes wrote: >> >> >> Only slightly off topic: >> >> Are those cppcheck reports automatically generated on a regular basis these days ? If not, and if interested, I got a small shell script that does that and is j

Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-17 Thread Julien Nabet
On 17/01/2015 16:03, Maarten Hoes wrote: Only slightly off topic: Are those cppcheck reports automatically generated on a regular basis these days ? If not, and if interested, I got a small shell script that does that and is just waiting for a vm and a crontab entry (see attachment). Hi, I

Re: cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-17 Thread Maarten Hoes
Hi, Only slightly off topic: Are those cppcheck reports automatically generated on a regular basis these days ? If not, and if interested, I got a small shell script that does that and is just waiting for a vm and a crontab entry (see attachment). - Maarten. cppcheck-report.sh Description: B

cppcheck: arrayIndexOutOfBounds report in stortree.cxx (store module)

2015-01-17 Thread julien2412
Hello, Cppcheck reported this: 41 OStoreBTreeNodeData::OStoreBTreeNodeData (sal_uInt16 nPageSize) 42 : OStorePageData (nPageSize) 43 { 44 base::m_aGuard.m_nMagic = store::htonl(self::theTypeId); 45 base::m_aDescr.m_nUsed = store::htons(self::thePageSize)