parent
cb8ee825fd
commit
f47fd20e14
|
@ -28,7 +28,7 @@
|
||||||
<function name="bswap_16">
|
<function name="bswap_16">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<returnValue type="uint16_t"/>
|
<returnValue type="uint16_t">((arg1 & 0xff00u) >> 8) | ((arg1 & 0x00ffu) << 8)</returnValue>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<const/>
|
<const/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<function name="bswap_32">
|
<function name="bswap_32">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<returnValue type="uint32_t"/>
|
<returnValue type="uint32_t">((arg1 & 0xff000000ul) >> 24) | ((arg1 & 0x00ff0000ul) >> 8) | ((arg1 & 0x0000ff00ul) << 8) | ((arg1 & 0x000000fful) << 24)</returnValue>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<const/>
|
<const/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
<function name="bswap_64">
|
<function name="bswap_64">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<returnValue type="uint64_t"/>
|
<returnValue type="uint64_t">((arg1 & 0xff00000000000000ull) >> 56) | ((arg1 & 0x00ff000000000000ull) >> 40) | ((arg1 & 0x0000ff0000000000ull) >> 24) | ((arg1 & 0x000000ff00000000ull) >> 8) | ((arg1 & 0x00000000ff000000ull) << 8) | ((arg1 & 0x0000000000ff0000ull) << 24) | ((arg1 & 0x000000000000ff00ull) << 40) | ((arg1 & 0x00000000000000ffull) << 56)</returnValue>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<const/>
|
<const/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
|
|
|
@ -153,6 +153,26 @@ void valid_code(int argInt1, va_list valist_arg, int * parg)
|
||||||
void * p_mmap = mmap(NULL, 1, PROT_NONE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
|
void * p_mmap = mmap(NULL, 1, PROT_NONE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
|
||||||
printf("%p", p_mmap);
|
printf("%p", p_mmap);
|
||||||
munmap(p_mmap, 1);
|
munmap(p_mmap, 1);
|
||||||
|
|
||||||
|
uint16_t i16_1 = 0, i16_2;
|
||||||
|
// cppcheck-suppress unreadVariable
|
||||||
|
i16_2 = __builtin_bswap16(i16_1++);
|
||||||
|
uint32_t i32_1 = 0, i32_2;
|
||||||
|
// cppcheck-suppress unreadVariable
|
||||||
|
i32_2 = __builtin_bswap32(i32_1++);
|
||||||
|
uint64_t i64_1 = 0, i64_2;
|
||||||
|
// cppcheck-suppress unreadVariable
|
||||||
|
i64_2 = __builtin_bswap64(i64_1++);
|
||||||
|
|
||||||
|
// cppcheck-suppress zerodiv
|
||||||
|
// cppcheck-suppress unreadVariable
|
||||||
|
i16_1 /= bswap_16(0x1234) - 0x3412;
|
||||||
|
// cppcheck-suppress zerodiv
|
||||||
|
// cppcheck-suppress unreadVariable
|
||||||
|
i32_1 /= bswap_32(0x12345678) - 0x78563412;
|
||||||
|
// cppcheck-suppress zerodiv
|
||||||
|
// cppcheck-suppress unreadVariable
|
||||||
|
i64_1 /= bswap_64(0x023456789abcde0f) - 0x0fdebc9a78563402;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ignoreleak(void)
|
void ignoreleak(void)
|
||||||
|
|
Loading…
Reference in New Issue