gnu.cfg: Improved configuration of ffsl() and ffsll()

This commit is contained in:
orbitcowboy 2022-05-01 15:29:35 +02:00
parent 178efb7058
commit e0ccfea027
3 changed files with 23 additions and 2 deletions

View File

@ -1161,7 +1161,8 @@
int ffsll(long long int i); -->
<function name="ffsl,ffsll">
<use-retval/>
<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 &amp;0</returnValue>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">

View File

@ -22,6 +22,26 @@
#include <sys/epoll.h>
#endif
#include <strings.h>
void knownConditionTrueFalse_ffsl(long i)
{
// ffs() returns the position of the first bit set, or 0 if no bits are set in i.
const int x = ffsl(0);
// cppcheck-suppress knownConditionTrueFalse
if (x == 0) {}
if (ffsl(i) == 0) {}
}
void knownConditionTrueFalse_ffsll(long long i)
{
// ffs() returns the position of the first bit set, or 0 if no bits are set in i.
const int x = ffsll(0);
// cppcheck-suppress knownConditionTrueFalse
if (x == 0) {}
if (ffsll(i) == 0) {}
}
int nullPointer_semtimedop(int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout)
{
(void) semtimedop(semid, sops, nsops, NULL); // If the timeout argument is NULL, then semtimedop() behaves exactly like semop().

View File

@ -31,8 +31,8 @@
#define _XOPEN_SOURCE
#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.