On some platforms, the 'd_name' field of struct dirent is not a static
fixed-sized array but a "flexarray" (i.e. a single character); in this
situation, 'd_name' points to a buffer allocated somewhere, usually
at the end of the buffer used for dirent (which is then allocated in a
bigger memory). Because of this, creating a struct dirent on stack as
buffer for readdir_r is not enough to store all the memory needed for
a dirent on those platforms.
As result, create an helper union with all the needed space, calculated
statically at build time. NAME_MAX+1 is still not a perfect option, but
it will do the job in the vast majority of cases.
Previously, if an enum value was set to a value unknown to cppcheck, the
next enum value would erroneously be set to the last set value plus one
(or zero, if no enum value had been set before). This partially fixes
Trac ticket #9647, in the sense that it no longer sets wrong values for
these enum values. Further improvements to this would be to set the
correct values instead. It also fixes the false positive mentioned in the
comments in the ticket.
- gui.pro: Update the path of the output file, so that it is also built
inside the help sub-directory (add $$PWD/help/ to the path):
-o $$PWD/help/online-help.qhc
- Use qcollectiongenerator in case of Qt version < 5.12, otherwise
qhelpgenerator
- appveyor.yml: Add %QTDIR%\bin to PATH. This allows qhelpgenerator
or qcollectiongenerator to be found
Fix return value types of library functions returning unsigned.
Previously, the valueType of auto x = f() would be signed even if f()
was specified to return an unsigned type.
This fixes#9941, which is a regression in cppcheck 2.2 compared to 2.1.
The regression was introduced in 32df807b22.