Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


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 you Stephan.
I put a comment to suppress this warning (see
http://cgit.freedesktop.org/libreoffice/core/commit/?id=ac8fdc7dd4f8ff8d896402838323c65e12c03e7c).
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.
I don't know what you mean by "flexible array member" but above all what
about if "n" (so  capacityCount()) is 1?
m_pData[1] would be out of bounds, wouldn't it?
I tried to Google a bit but didn't find something relevant.

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/cppcheck-arrayIndexOutOfBounds-report-in-stortree-cxx-store-module-tp4136432p4136718.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.