CheckUninitVar::isMemberVariableAssignment uses argument direction "out"
now also to check for assignment when the member variable is handed over
to a function by reference.
testuninitvar.cpp: Improve tests, use a test library configuration.
wprintf(): The format string must be initialized. So add `<not-uninit/>`
swprintf(): `<formatstr/>` should not be used because Microsoft uses the
same function with a different order of the arguments. Add comment to
document this in the library configuration also. See ticket
https://trac.cppcheck.net/ticket/4790
CheckUninitVar::isMemberVariableAssignment uses argument direction
to check for assignment when the member variable is handed over to a
function by reference. Currently implemented for "in" direction. "out"
will be added with another commit.
As can be read here:
https://www.gnu.org/software/gettext//manual/html_node/Mark-Keywords.html
The _(str) macro is typically defined for a project to abbreviate the
gettext(str) call. Although this is not part of GNU it would enhance the
analysis. Cppcheck often does not know what _() is. In daca@home it is
reported thousands of times as a function without configuration.
lib/settings.cpp:53:7: warning: field 'removeUnusedIncludedTemplates' will be
initialized after field 'removeUnusedTemplates' [-Wreorder]
removeUnusedIncludedTemplates(false),
^
lib/settings.cpp:54:7: warning: field 'removeUnusedTemplates' will be
initialized after field 'checkConfiguration' [-Wreorder]
removeUnusedTemplates(false),
^
strcpy_s belongs to the standard so it must be in std.cfg instead of
windows.cfg.
Configuration for strcpy_s has been improved and tests were added.
Found by daca@home
sprintf_s works very similar but it is already configured in the
windows library. Configuring sprintf_s in std.cfg leads to conflicts in
the windows configuration tests.
Found by daca@home
I added all argument directions i know or where i was able to find
information without too much effort. When in doubt i looked at the
Microsoft SAL annotations and used similar configurations when this
made sense.
* std.cfg: Add further argument directions (in, out, inout).
* testlibrary.cpp: Add test for function argument direction configuration.
* std.cfg: runastyle and add some more direction configurations.
* library.h: Add documentation for function argument direction enum.
* Do not use "direction" library information for pointer arguments.
Also fix further unmatched uninitvar messages in std configuration
tests.
* std.cfg: Add more argument direction configurations.
* test/cfg/std.c: Add test for argument direction configuration.
* astutils.cpp: Only ignore pointer arguments for out/inout arguments.
* library.h: Use suggested documentation for argument direction enum.