std.cfg: Added returnValue calculation for isless(), islessgreater() etc.
This commit is contained in:
parent
a722ba4f89
commit
b4aa04db41
11
cfg/std.cfg
11
cfg/std.cfg
|
@ -3178,7 +3178,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<function name="isgreater,std::isgreater">
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<returnValue type="int"/>
|
||||
<returnValue type="int">arg1>arg2?1:0</returnValue>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -3192,7 +3192,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<function name="isgreaterequal,std::isgreaterequal">
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<returnValue type="int"/>
|
||||
<returnValue type="int">arg1 >= arg2?1:0</returnValue>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -3255,7 +3255,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<function name="isless,std::isless">
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<returnValue type="int"/>
|
||||
<returnValue type="int">arg1<arg2?1:0</returnValue>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -3269,7 +3269,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<function name="islessequal,std::islessequal">
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<returnValue type="int"/>
|
||||
<returnValue type="int">arg1 <= arg2?1:0</returnValue>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -3283,7 +3283,8 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<function name="islessgreater,std::islessgreater">
|
||||
<use-retval/>
|
||||
<pure/>
|
||||
<returnValue type="int"/>
|
||||
<returnValue type="int">(arg1<arg2 || arg1>arg2)?1:0</returnValue>
|
||||
<!-- true if x < y || x > y, false otherwise -->
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
|
|
@ -27,6 +27,49 @@
|
|||
#include <vector>
|
||||
#include <cstdarg>
|
||||
|
||||
void returnValue_std_isgreater(void)
|
||||
{
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (std::isgreater(4,2) == 0) {}
|
||||
// @todo support floats
|
||||
if (std::isgreater(4.0f,2.0f) == 0) {}
|
||||
}
|
||||
|
||||
void returnValue_std_isgreaterequal(void)
|
||||
{
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (std::isgreaterequal(4,2) == 0) {}
|
||||
// @todo support floats
|
||||
if (std::isgreaterequal(4.0f,2.0f) == 0) {}
|
||||
}
|
||||
|
||||
void returnValue_std_isless(void)
|
||||
{
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (std::isless(4,2) == 0) {}
|
||||
// @todo support floats
|
||||
if (std::isless(4.0f,2.0f) == 0) {}
|
||||
}
|
||||
|
||||
void returnValue_std_islessequal(void)
|
||||
{
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (std::islessequal(4,2) == 0) {}
|
||||
// @todo support floats
|
||||
if (std::islessequal(4.0f,2.0f) == 0) {}
|
||||
}
|
||||
|
||||
void returnValue_std_islessgreater(void)
|
||||
{
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (std::islessgreater(4,2) == 0) {}
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (std::islessgreater(2,4) == 0) {}
|
||||
|
||||
if (std::islessgreater(4.0f,2.0f) == 0) {} // @todo support floats
|
||||
if (std::islessgreater(2.0f,4.0f) == 0) {} // @todo support floats
|
||||
}
|
||||
|
||||
void bufferAccessOutOfBounds(void)
|
||||
{
|
||||
char a[5];
|
||||
|
|
Loading…
Reference in New Issue