-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
std.cfg: Added 'indirect' flag for destination argument of 'mbstrtowc…
…' function.
- Loading branch information
1 parent
7841430
commit 177eed1
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1651,14 +1651,23 @@ void uninitvar_mbstowcs(void) | |
(void)mbstowcs(ws,s,n); | ||
} | ||
|
||
void uninitvar_mbsrtowcs(void) | ||
void uninitvar_mbsrtowcs(wchar_t* d, const char** s, size_t m, mbstate_t *p) | ||
{ | ||
wchar_t* dest; | ||
const char* src; | ||
size_t max; | ||
mbstate_t* ps; | ||
// cppcheck-suppress uninitvar | ||
(void)mbsrtowcs(dest,&src,max,ps); | ||
(void)mbsrtowcs(dest,s,m,p); | ||
// cppcheck-suppress uninitvar | ||
(void)mbsrtowcs(dest,&src,m,p); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
orbitcowboy
Author
Collaborator
|
||
// cppcheck-suppress uninitvar | ||
(void)mbsrtowcs(dest,s,max,p); | ||
// cppcheck-suppress uninitvar | ||
(void)mbsrtowcs(dest,s,m,ps); | ||
|
||
// No warning is expected | ||
(void)mbsrtowcs(d,s,m,p); | ||
} | ||
|
||
void uninitvar_wctob(void) | ||
|
Since
dest
is uninitialized, Cppcheck will issue a warning for the first argument. So it does not make a difference whether&src
is initialized or not. IMHO it would be better to used
instead ofdest
for this and the following function calls, so we are sure that the other arguments are verified. What do you think?