From bbe9fad81db738eaabb8e9b95e39a6464c7835a6 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 12 Feb 2018 16:42:23 +0100 Subject: [PATCH] std library: Resolve two TODOs (#1074) First resolved TODO in std.c is obsolete since the "res" variable is used later and there is therefore no warning issued. Second resolved TODO in std.c: A warning for uninit variables is issued by cppcheck, so this check can be enabled. Since assert() has no noreturn configuration (currently a useful configuration is not really possible, see ticket 8329) the check-library message is suppressed. --- test/cfg/std.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/cfg/std.c b/test/cfg/std.c index 1322ff35f..68951e530 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -201,7 +201,6 @@ void nullpointer(int value) // #6100 False positive nullPointer - calling mbstowcs(NULL,) res += mbstowcs(0,"",0); - // TODO cppcheck-suppress unreadVariable res += wcstombs(0,L"",0); strtok(NULL,"xyz"); @@ -483,14 +482,13 @@ void uninitvar_asctime(void) (void)asctime(tm); } -#if 0 void uninitvar_assert(void) { int i; - // TODO cppcheck-suppress uninitvar + // cppcheck-suppress checkLibraryNoReturn + // cppcheck-suppress uninitvar assert(i); } -#endif void uninitvar_sqrt(void) {