@@ -145,11 +145,16 @@ static CppcheckLibraryData::Function loadFunction(QXmlStreamReader &xmlReader, c
145145 function.formatstr .secure = xmlReader.attributes ().value (" secure" ).toString ();
146146 } else if (elementName == " arg" )
147147 function.args .append (loadFunctionArg (xmlReader));
148+ else if (elementName == " warn" ) {
149+ function.warn .severity = xmlReader.attributes ().value (" severity" ).toString ();
150+ function.warn .reason = xmlReader.attributes ().value (" reason" ).toString ();
151+ function.warn .alternatives = xmlReader.attributes ().value (" alternatives" ).toString ();
152+ function.warn .msg = xmlReader.readElementText ();
153+ }
148154 }
149155 return function;
150156}
151157
152-
153158static CppcheckLibraryData::MemoryResource loadMemoryResource (QXmlStreamReader &xmlReader)
154159{
155160 CppcheckLibraryData::MemoryResource memoryresource;
@@ -329,6 +334,25 @@ static void writeFunction(QXmlStreamWriter &xmlWriter, const CppcheckLibraryData
329334
330335 xmlWriter.writeEndElement ();
331336 }
337+
338+ if (!function.warn .isEmpty ()) {
339+ xmlWriter.writeStartElement (" warn" );
340+
341+ if (!function.warn .severity .isEmpty ())
342+ xmlWriter.writeAttribute (" severity" , function.warn .severity );
343+
344+ if (!function.warn .reason .isEmpty ())
345+ xmlWriter.writeAttribute (" reason" , function.warn .reason );
346+
347+ if (!function.warn .alternatives .isEmpty ())
348+ xmlWriter.writeAttribute (" alternatives" , function.warn .alternatives );
349+
350+ if (!function.warn .msg .isEmpty ())
351+ xmlWriter.writeCharacters (function.warn .msg );
352+
353+ xmlWriter.writeEndElement ();
354+ }
355+
332356 xmlWriter.writeEndElement ();
333357}
334358
0 commit comments