posix.cfg: Improved configuration for ffs().
This commit is contained in:
parent
925902245f
commit
178efb7058
|
@ -4966,7 +4966,8 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<!-- http://man7.org/linux/man-pages/man3/ffs.3.html -->
|
||||
<!-- int ffs(int i); -->
|
||||
<function name="ffs">
|
||||
<returnValue type="int"/>
|
||||
<!-- It returns the position of the first bit set, or 0 if no bits are set in i. -->
|
||||
<returnValue type="int">arg1==0 &0</returnValue>
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
|
|
|
@ -32,6 +32,16 @@
|
|||
#include <wchar.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <strings.h>
|
||||
void knownConditionTrueFalse_ffs(int i)
|
||||
{
|
||||
// ffs() returns the position of the first bit set, or 0 if no bits are set in i.
|
||||
const int x = ffs(0);
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (x == 0) {}
|
||||
if (ffs(i) == 0) {}
|
||||
}
|
||||
|
||||
ssize_t nullPointer_readlink(const char *path, char *buf, size_t bufsiz)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
|
|
Loading…
Reference in New Issue