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.
This commit is contained in:
Sebastian 2018-02-12 16:42:23 +01:00 committed by GitHub
parent cd5adf0707
commit bbe9fad81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -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)
{