Add support for InvalidFunctionArg lgamma() (#5845)
Reference: https://en.cppreference.com/w/cpp/numeric/math/lgamma
This commit is contained in:
parent
fde7ea6d17
commit
32cabecca9
|
@ -3035,6 +3035,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- https://cplusplus.com/reference/cmath/lgamma/ -->
|
||||||
<!-- double lgamma(double x); -->
|
<!-- double lgamma(double x); -->
|
||||||
<function name="lgamma,std::lgamma">
|
<function name="lgamma,std::lgamma">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
|
@ -3044,8 +3045,11 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
<!-- If x is zero or a negative integer for which the function is asymptotic, it may cause a pole error (depending on implementation).-->
|
||||||
|
<valid>!0.0:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- https://cplusplus.com/reference/cmath/lgamma/ -->
|
||||||
<!-- float lgammaf(float x); -->
|
<!-- float lgammaf(float x); -->
|
||||||
<function name="lgammaf,std::lgammaf">
|
<function name="lgammaf,std::lgammaf">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
|
@ -3055,8 +3059,11 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
<!-- If x is zero or a negative integer for which the function is asymptotic, it may cause a pole error (depending on implementation).-->
|
||||||
|
<valid>!0.0:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- https://cplusplus.com/reference/cmath/lgamma/ -->
|
||||||
<!-- long double lgammal(long double x); -->
|
<!-- long double lgammal(long double x); -->
|
||||||
<function name="lgammal,std::lgammal">
|
<function name="lgammal,std::lgammal">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
|
@ -3066,6 +3073,8 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<arg nr="1" direction="in">
|
<arg nr="1" direction="in">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
<!-- If x is zero or a negative integer for which the function is asymptotic, it may cause a pole error (depending on implementation).-->
|
||||||
|
<valid>!0.0:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!-- double rint(double x); -->
|
<!-- double rint(double x); -->
|
||||||
|
|
|
@ -2382,6 +2382,30 @@ void uninitvar_ldexp(void)
|
||||||
(void)std::ldexp(ldc,e3);
|
(void)std::ldexp(ldc,e3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void invalidFunctionArg_lgamma(float f, double d, long double ld)
|
||||||
|
{
|
||||||
|
(void)lgamma(d);
|
||||||
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
(void)lgamma(-0.1);
|
||||||
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
(void)lgamma(0.0);
|
||||||
|
(void)lgamma(0.1);
|
||||||
|
|
||||||
|
(void)lgammaf(f);
|
||||||
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
(void)lgammaf(-0.1f);
|
||||||
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
(void)lgammaf(0.0f);
|
||||||
|
(void)lgammaf(0.1f);
|
||||||
|
|
||||||
|
(void)lgammal(ld);
|
||||||
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
(void)lgammal(-0.1L);
|
||||||
|
// cppcheck-suppress invalidFunctionArg
|
||||||
|
(void)lgammal(0.0L);
|
||||||
|
(void)lgammal(0.1L);
|
||||||
|
}
|
||||||
|
|
||||||
void uninitvar_lgamma(void)
|
void uninitvar_lgamma(void)
|
||||||
{
|
{
|
||||||
float f;
|
float f;
|
||||||
|
|
Loading…
Reference in New Issue