Add more string conversion functions to library files

This commit is contained in:
Alexander Mai 2015-03-01 20:18:26 +01:00
parent 830f656a25
commit 49099e78ff
3 changed files with 179 additions and 0 deletions

View File

@ -60,4 +60,129 @@
<not-uninit/>
</arg>
</function>
<!-- char *qecvt(long double value, int ndigit, int * decpt, int * sign); -->
<function name="ecvt">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
</function>
<!-- char *qfcvt(double value, int ndigit, int * decpt, int * sign); -->
<function name="qfcvt">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
</function>
<!-- char *qgcvt(long double value, int ndigit, char *buf); -->
<function name="qgcvt">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
</function>
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="ecvt_r">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
<arg nr="5">
<not-null/>
</arg>
<arg nr="6"/>
</function>
<!-- int fcvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="ecvt_r">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
<arg nr="5">
<not-null/>
</arg>
<arg nr="6"/>
</function>
<!-- int qecvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="qecvt_r">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
<arg nr="5">
<not-null/>
</arg>
<arg nr="6"/>
</function>
<!-- int qfcvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="qfcvt_r">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
<arg nr="5">
<not-null/>
</arg>
<arg nr="6"/>
</function>
</def>

View File

@ -997,4 +997,52 @@
<function name="sched_yield">
<noreturn>false</noreturn>
</function>
<!-- char *ecvt(double value, int ndigit, int *restrict decpt, int *restrict sign);
LEGACY in POSIX.1-2001, removed in POSIX.1-2008-->
<function name="ecvt">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
</function>
<!-- char *fcvt(double value, int ndigit, int *restrict decpt, int *restrict sign);
LEGACY in POSIX.1-2001, removed in POSIX.1-2008-->
<function name="fcvt">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
<arg nr="4">
<not-null/>
</arg>
</function>
<!-- char *gcvt(double value, int ndigit, char *buf);
LEGACY in POSIX.1-2001, removed in POSIX.1-2008-->
<function name="gcvt">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
</arg>
</function>
</def>

View File

@ -143,6 +143,12 @@ void uninitvar(int fd) {
pattern="";
// cppcheck-suppress uninitvar
regcomp(&reg, pattern, cflags);
int decimal, sign;
double d;
// cppcheck-suppress uninitvar
// cppcheck-suppress unreadVariable
char *buffer = ecvt(d, 11, &decimal, &sign);
gcvt(3.141, 2, NULL);
}
void uninitvar_types(void) {