posix.cfg: improve configuration for dlsym()

This commit is contained in:
amai2012 2019-01-12 21:50:02 +01:00
parent 6eca26a4cf
commit 2adf65968b
2 changed files with 3 additions and 0 deletions

View File

@ -95,6 +95,7 @@
<function name="dlsym"> <function name="dlsym">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<use-retval/>
<returnValue type="void*"/> <returnValue type="void*"/>
<arg nr="1"> <arg nr="1">
<not-uninit/> <not-uninit/>

View File

@ -343,6 +343,8 @@ void dl(const char* libname, const char* func)
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
// cppcheck-suppress unreadVariable // cppcheck-suppress unreadVariable
void* sym = dlsym(lib, funcname); void* sym = dlsym(lib, funcname);
// cppcheck-suppress ignoredReturnValue
dlsym(lib, "foo");
void* uninit; void* uninit;
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
dlclose(uninit); dlclose(uninit);