saving std.cfg with libraryeditor, applied some of the generated diffs.

This commit is contained in:
Daniel Marjamäki 2015-09-03 07:00:43 +02:00
parent 34551203a6
commit bfb70f3312
2 changed files with 92 additions and 77 deletions

View File

@ -79,12 +79,13 @@
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- void assert(int expression) -->
<function name="assert">
<noreturn>true</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
@ -308,10 +309,10 @@
</function>
<!-- int fegetround(void); -->
<function name="fegetround,std::fegetround">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
</function>
<!-- int feholdexcept(fenv_t* envp); -->
<function name="feholdexcept,std::feholdexcept">
@ -616,8 +617,8 @@
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- double difftime(time_t time2, time_t time1); -->
@ -1277,8 +1278,8 @@
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
@ -1341,9 +1342,9 @@
<!-- int wctob(wint_t wc); -->
<function name="wctob,std::wctob">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-uninit/>
</arg>
@ -1934,8 +1935,8 @@
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- double log(double x); -->
@ -1973,8 +1974,8 @@
</function>
<!-- int fpclassify(double x); -->
<function name="fpclassify,std::fpclassify">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -1983,8 +1984,8 @@
</function>
<!-- int isfinite(double x); -->
<function name="isfinite,std::isfinite">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -1993,8 +1994,8 @@
</function>
<!-- int isgreater(double x, double y); -->
<function name="isgreater,std::isgreater">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2006,8 +2007,8 @@
</function>
<!-- int isgreaterequal(double x, double y); -->
<function name="isgreaterequal,std::isgreaterequal">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2019,8 +2020,8 @@
</function>
<!-- int isinf(double x); -->
<function name="isinf,std::isinf">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2031,8 +2032,8 @@
<!-- float logbf(float x); -->
<!-- long double logbl(long double x); -->
<function name="logb,std::logb,logbf,std::logbf,logbl,std::logbl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2041,8 +2042,8 @@
</function>
<!-- int isless(double x, double y); -->
<function name="isless,std::isless">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2054,8 +2055,8 @@
</function>
<!-- int islessequal(double x, double y); -->
<function name="islessequal,std::islessequal">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2067,8 +2068,8 @@
</function>
<!-- int islessgreater(double x, double y); -->
<function name="islessgreater,std::islessgreater">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2082,8 +2083,8 @@
<!-- float nanf(const char *tagp); -->
<!-- long double nanl(const char *tagp); -->
<function name="nan,std::nan,nanf,std::nanf,nanl,std::nanl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2093,8 +2094,8 @@
</function>
<!-- int isnan(double x); -->
<function name="isnan,std::isnan">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2103,8 +2104,8 @@
</function>
<!-- int isnormal(double x); -->
<function name="isnormal,std::isnormal">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2113,8 +2114,8 @@
</function>
<!-- int isunordered(double x, double y);-->
<function name="isunordered,std::isunordered">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2128,8 +2129,8 @@
<!-- int ilogbf(float x); -->
<!-- int ilogbl(long double x); -->
<function name="ilogb,std::ilogb,ilogbf,ilogbl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2140,8 +2141,8 @@
<!-- float log10f(float x);-->
<!-- long double log10l(long double x); -->
<function name="log10,std::log10,log10f,log10l">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2152,8 +2153,8 @@
<!-- float log1pf(float x); -->
<!-- long double log1pl(long double x); -->
<function name="log1p,std::log1p,log1pf,std::log1pf,log1pl,std::log1pl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2164,8 +2165,8 @@
<!-- float log2f(float x); -->
<!-- long double log2l(long double x); -->
<function name="log2,std::log2,log2f,std::log2f,log2l,std::log2l">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2176,8 +2177,8 @@
<!-- float nearbyintf(float x); -->
<!-- long double nearbyintl(long double x); -->
<function name="nearbyint,std::nearbyint,nearbyintf,std::nearbyintf,nearbyintl,std::nearbyintl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2188,8 +2189,8 @@
<!-- float nextafterf(float x, float y); -->
<!-- long double nextafterl(long double x, long double y);-->
<function name="nextafter,std::nextafter,nextafterf,std::nextafterf,nextafterl,std::nextafterl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2203,8 +2204,8 @@
<!-- float nexttowardf(float x, long double y); -->
<!-- long double nexttowardl(long double x, long double y); -->
<function name="nexttoward,std::nexttoward,nexttowardf,std::nexttowardf,nexttowardl,std::nexttowardl">
<pure/>
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -2726,12 +2727,14 @@
</function>
<!-- void (*signal(int sig, void (*func)(int)))(int); -->
<function name="signal">
<noreturn>true</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- int raise(int sig); -->
<function name="raise">
<noreturn>true</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
@ -2742,8 +2745,8 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-null/>
<formatstr/>
<not-null/>
</arg>
</function>
<!-- int vsscanf(const char *s, const char *format, va_list arg); -->
@ -2752,8 +2755,8 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="2">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="3"/>
</function>
@ -2763,8 +2766,8 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="2">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="3"/>
</function>
@ -2774,8 +2777,8 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="2"/>
</function>
@ -2785,8 +2788,8 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="2"/>
</function>
@ -2906,8 +2909,8 @@
<!-- int strcmp(const char *str1, const char *str2); -->
<function name="strcmp,std::strcmp">
<use-retval/>
<noreturn>false</noreturn>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
@ -2923,8 +2926,8 @@
<!-- int wcscmp(const wchar_t *str1, const wchar_t c); -->
<function name="wcscmp">
<use-retval/>
<noreturn>false</noreturn>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
@ -2984,9 +2987,9 @@
<!-- size_t strlen(const char *string); -->
<function name="strlen,std::strlen">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -2996,9 +2999,9 @@
<!-- size_t wcslen(const wchar_t *string); -->
<function name="wcslen">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -3075,8 +3078,8 @@
<!-- int strncmp(const char *s1, const char *s2, size_t n); -->
<function name="strncmp,std::strncmp">
<use-retval/>
<noreturn>false</noreturn>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
@ -3094,8 +3097,8 @@
<!-- int wcsncmp(const wchar_t* wcs1, const wchar_t* wcs2, size_t num); -->
<function name="wcsncmp">
<use-retval/>
<noreturn>false</noreturn>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
@ -3129,9 +3132,9 @@
<!-- wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2); -->
<function name="wcsstr">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -3187,9 +3190,9 @@
<!-- size_t wcsspn(const wchar_t *s1, const wchar_t *s2); -->
<function name="wcsspn">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -3228,9 +3231,9 @@
<!-- size_t strcspn(const char *cs, const char *ct); -->
<function name="strcspn">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -3243,9 +3246,9 @@
<!-- size_t wcscspn(const wchar_t *cs, const wchar_t *ct); -->
<function name="wcscspn">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -3330,9 +3333,9 @@
char * strpbrk( char * str1, const char * str2); -->
<function name="strbprk">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -3392,8 +3395,8 @@
<not-uninit/>
</arg>
<arg nr="3">
<valid>0,2:36</valid>
<not-uninit/>
<valid>0,2:36</valid>
</arg>
</function>
<!-- float strtof(const char *s, char **endp); -->
@ -3513,8 +3516,8 @@
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
<not-null/>
<not-uninit/>
</arg>
<arg nr="3">
<not-null/>
@ -3558,8 +3561,8 @@
<leak-ignore/>
<formatstr/>
<arg nr="1">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="any">
<not-uninit/>
@ -3595,8 +3598,8 @@
<leak-ignore/>
<formatstr/>
<arg nr="2">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="3"/>
</function>
@ -3604,13 +3607,13 @@
<function name="vswprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="2">
<not-uninit/>
</arg>
<formatstr/>
<arg nr="3">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="4"/>
</function>
@ -3618,39 +3621,39 @@
<function name="fwprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="1">
<not-null/>
</arg>
<formatstr/>
<arg nr="2">
<not-null/>
<formatstr/>
<not-null/>
</arg>
</function>
<!-- int snprintf(char *s, size_t n, const char *format, ...); -->
<function name="snprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="2">
<not-uninit/>
</arg>
<formatstr/>
<arg nr="3">
<not-null/>
<formatstr/>
<not-null/>
</arg>
</function>
<!-- int vsnprintf(char *s, size_t n, const char *format, va_list arg); -->
<function name="vsnprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="2">
<not-uninit/>
</arg>
<formatstr/>
<arg nr="3">
<not-null/>
<formatstr/>
<not-null/>
</arg>
<arg nr="4"/>
</function>
@ -3668,8 +3671,8 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-null/>
<formatstr/>
<not-null/>
</arg>
</function>
<!-- int sscanf(const char *string, const char * format, ...); -->
@ -3685,13 +3688,13 @@
<function name="fwscanf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-null/>
</arg>
<formatstr scan="true"/>
<arg nr="2">
<not-null/>
<formatstr/>
<not-null/>
</arg>
</function>
<!-- int swscanf(const wchar_t *string, const wchar_t *format, ...); -->

View File

@ -166,45 +166,55 @@ static QDomElement FunctionElement(QDomDocument &doc, const CppcheckLibraryData:
{
QDomElement functionElement = doc.createElement("function");
functionElement.setAttribute("name", function.name);
if (!function.noreturn) {
QDomElement e = doc.createElement("noreturn");
e.appendChild(doc.createTextNode("false"));
functionElement.appendChild(e);
}
if (function.useretval)
functionElement.appendChild(doc.createElement("use-retval"));
if (function.leakignore)
functionElement.appendChild(doc.createElement("leak-ignore"));
if (function.gccConst)
functionElement.appendChild(doc.createElement("const"));
if (function.gccPure)
functionElement.appendChild(doc.createElement("pure"));
if (!function.formatstr.scan.isNull()) {
QDomElement e = doc.createElement("formatstr");
e.setAttribute("scan", function.formatstr.scan);
if (!function.formatstr.secure.isNull())
e.setAttribute("secure", function.formatstr.secure);
{
QDomElement e = doc.createElement("noreturn");
e.appendChild(doc.createTextNode(function.noreturn ? "true" : "false"));
functionElement.appendChild(e);
}
if (function.leakignore)
functionElement.appendChild(doc.createElement("leak-ignore"));
/*
if (!function.formatstr.scan.isNull()) {
QDomElement e = doc.createElement("formatstr");
e.setAttribute("scan", function.formatstr.scan);
if (!function.formatstr.secure.isNull())
e.setAttribute("secure", function.formatstr.secure);
functionElement.appendChild(e);
}
*/
// Argument info..
foreach(const CppcheckLibraryData::Function::Arg &arg, function.args) {
if (arg.formatstr) {
QDomElement e = doc.createElement("formatstr");
if (!function.formatstr.scan.isNull())
e.setAttribute("scan", function.formatstr.scan);
if (!function.formatstr.secure.isNull())
e.setAttribute("secure", function.formatstr.secure);
functionElement.appendChild(e);
}
QDomElement argElement = doc.createElement("arg");
functionElement.appendChild(argElement);
if (arg.nr == CppcheckLibraryData::Function::Arg::ANY)
argElement.setAttribute("nr", "any");
else
argElement.setAttribute("nr", arg.nr);
if (arg.notbool)
argElement.appendChild(doc.createElement("not-bool"));
if (arg.formatstr)
argElement.appendChild(doc.createElement("formatstr"));
if (arg.notnull)
argElement.appendChild(doc.createElement("not-null"));
if (arg.notuninit)
argElement.appendChild(doc.createElement("not-uninit"));
if (arg.notbool)
argElement.appendChild(doc.createElement("not-bool"));
if (arg.strz)
argElement.appendChild(doc.createElement("strz"));
if (arg.formatstr)
argElement.appendChild(doc.createElement("formatstr"));
if (!arg.valid.isEmpty()) {
QDomElement e = doc.createElement("valid");
@ -279,8 +289,10 @@ QString CppcheckLibraryData::toString() const
foreach(const PodType &podtype, podtypes) {
QDomElement podtypeElement = doc.createElement("podtype");
podtypeElement.setAttribute("name", podtype.name);
podtypeElement.setAttribute("size", podtype.size);
podtypeElement.setAttribute("sign", podtype.sign);
if (!podtype.size.isEmpty())
podtypeElement.setAttribute("size", podtype.size);
if (!podtype.sign.isEmpty())
podtypeElement.setAttribute("sign", podtype.sign);
root.appendChild(podtypeElement);
}