Re: [xml] Reporting GCC 7.2.0 compiler-warnings on libxml2-2.9.5



On 8-9-2017 2:15, Reino Wijnsma <rwijnsma xs4all nl> wrote:
Hello Daniel Veillard,

I've just compiled libxml2-2.9.5 with GCC 7.2.0 and this script to build FFmpeg in the end.
It compiled without errors, but I did get A LOT of warnings!
I thought I'd subscribe to this mailing list to share it with you.

With kind regards,
Reino
libxml2-2.9.6:

make  all-recursive
make[1]: Entering directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6'
Making all in include
make[2]: Entering directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6/include'
Making all in libxml
make[3]: Entering directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6/include/libxml'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6/include/libxml'
make[3]: Entering directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6/include'
make[2]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6/include'
Making all in .
make[2]: Entering directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6'
  CC       SAX.lo
  CC       entities.lo
  CC       encoding.lo
  CC       error.lo
  CC       parserInternals.lo
  CC       parser.lo
  CC       tree.lo
tree.c: In function 'xmlDOMWrapRemoveNode':
tree.c:8252:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if ((ctxt == NULL) && (node->nsDef != NULL)) {
      ^
tree.c:8262:6: note: here
      case XML_ATTRIBUTE_NODE:
      ^~~~
tree.c: In function 'xmlDOMWrapReconcileNamespaces':
tree.c:8850:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (! adoptns)
      ^
tree.c:8853:6: note: here
      case XML_ATTRIBUTE_NODE:
      ^~~~
tree.c: In function 'xmlDOMWrapAdoptBranch':
tree.c:9092:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if ((cur->nsDef) &&
      ^
tree.c:9134:6: note: here
      case XML_ATTRIBUTE_NODE:
      ^~~~
  CC       hash.lo
  CC       list.lo
  CC       xmlIO.lo
xmlIO.c:63:0: warning: "stat" redefined
 #      define stat _stat

In file included from xmlIO.c:24:0:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/sys/stat.h:265:0: note: this is the location of the previous definition
 #define stat _stat32i64

xmlIO.c: In function 'xmlCheckHTTPInput':
xmlIO.c:3877:36: warning: unused parameter 'ctxt' [-Wunused-parameter]
 xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret) {
                                    ^~~~
  CC       xmlmemory.lo
  CC       uri.lo
uri.c: In function 'xmlCanonicPath':
uri.c:2480:14: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
  uri->scheme = xmlStrdup(BAD_CAST "file");
              ^
uri.c:2489:4: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
  p = uri->path + 1;
    ^
uri.c:2490:10: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
  strncpy(p, path, len + 1);
          ^
In file included from uri.c:14:0:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/string.h:89:9: note: expected 'char * restrict' but argument is of type 'xmlChar * {aka unsigned char *}'
   char *strncpy(char * __restrict__ _Dest,const char * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
         ^~~~~~~
uri.c:2490:13: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign]
  strncpy(p, path, len + 1);
             ^~~~
In file included from uri.c:14:0:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/string.h:89:9: note: expected 'const char * restrict' but argument is of type 'const xmlChar * {aka const unsigned char *}'
   char *strncpy(char * __restrict__ _Dest,const char * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
         ^~~~~~~
uri.c:2492:12: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
  uri->path = xmlStrdup(path);
            ^
uri.c:2497:4: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
  p = uri->path;
    ^
uri.c:2397:9: warning: unused variable 'i' [-Wunused-variable]
     int i = 0;
         ^
  CC       valid.lo
valid.c: In function 'xmlSnprintfElements':
valid.c:5191:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (xmlIsBlankNode(cur))
      ^
valid.c:5193:13: note: here
             case XML_CDATA_SECTION_NODE:
             ^~~~
  CC       xlink.lo
  CC       HTMLparser.lo
  CC       HTMLtree.lo
  CC       debugXML.lo
  CC       xpath.lo
In file included from ./include/libxml/parser.h:18:0,
                 from ./include/libxml/globals.h:18,
                 from ./include/libxml/threads.h:35,
                 from ./include/libxml/xmlmemory.h:218,
                 from xpath.c:44:
xpath.c: In function 'xmlXPathRegisterFuncNS':
xpath.c:4896:73: warning: ISO C forbids passing argument 4 of 'xmlHashAddEntry2' between function pointer and 'void *' [-Wpedantic]
     return(xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, XML_CAST_FPTR(f)));
                                                                         ^
./include/libxml/hash.h:56:29: note: in definition of macro 'XML_CAST_FPTR'
 #define XML_CAST_FPTR(fptr) fptr
                             ^~~~
./include/libxml/hash.h:128:4: note: expected 'void *' but argument is of type 'xmlXPathFunction {aka void (*)(struct _xmlXPathParserContext *, int)}'
    xmlHashAddEntry2(xmlHashTablePtr table,
    ^~~~~~~~~~~~~~~~
xpath.c: In function 'xmlXPathFunctionLookupNS':
xpath.c:4977:24: warning: ISO C forbids assignment between function pointer and 'void *' [-Wpedantic]
     XML_CAST_FPTR(ret) = xmlHashLookup2(ctxt->funcHash, name, ns_uri);
                        ^
xpath.c: In function 'xmlXPathEqualValuesCommon':
xpath.c:7047:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
       arg2 = valuePop(ctxt);
       ~~~~~^~~~~~~~~~~~~~~~
xpath.c:7049:3: note: here
   case XPATH_NUMBER:
   ^~~~
In file included from xpath.c:482:0:
At top level:
trionan.c:218:1: warning: 'trio_is_negative' defined but not used [-Wunused-function]
 trio_is_negative
 ^~~~~~~~~~~~~~~~
trionan.c:194:1: warning: 'trio_is_special_quantity' defined but not used [-Wunused-function]
 trio_is_special_quantity
 ^~~~~~~~~~~~~~~~~~~~~~~~
  CC       xpointer.lo
  CC       xinclude.lo
  CC       nanohttp.lo
  CC       nanoftp.lo
  CC       catalog.lo
catalog.c: In function 'xmlParseSGMLCatalog':
catalog.c:2397:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
       if (*cur == '%')
          ^
catalog.c:2399:3: note: here
   case SGML_CATA_PENTITY:
   ^~~~
  CC       globals.lo
  CC       threads.lo
threads.c: In function 'xmlOnceInit':
threads.c:942:34: warning: pointer targets in passing argument 1 of 'InterlockedIncrement' differ in signedness [-Wpointer-sign]
         if (InterlockedIncrement(&run_once.control) == 1) {
                                  ^
In file included from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/winbase.h:22:0,
                 from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/windows.h:70,
                 from threads.c:30:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/interlockedapi.h:29:37: note: expected 'volatile LONG * {aka volatile long int *}' but argument is of type 'DWORD * {aka long unsigned int *}'
   __MINGW_INTRIN_INLINE LONG WINAPI InterlockedIncrement(LONG volatile *lpAddend) {
                                     ^~~~~~~~~~~~~~~~~~~~
  CC       c14n.lo
  CC       xmlstring.lo
  CC       buf.lo
  CC       xmlregexp.lo
xmlregexp.c: In function 'xmlRegCheckCharacterRange':
xmlregexp.c:2812:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
      neg = !neg;
      ~~~~^~~~~~
xmlregexp.c:2813:9: note: here
         case XML_REGEXP_ANYSPACE:
         ^~~~
xmlregexp.c:2818:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
      neg = !neg;
      ~~~~^~~~~~
xmlregexp.c:2819:9: note: here
         case XML_REGEXP_INITNAME:
         ^~~~
xmlregexp.c:2824:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
      neg = !neg;
      ~~~~^~~~~~
xmlregexp.c:2825:9: note: here
         case XML_REGEXP_NAMECHAR:
         ^~~~
xmlregexp.c:2832:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
      neg = !neg;
      ~~~~^~~~~~
xmlregexp.c:2833:9: note: here
         case XML_REGEXP_DECIMAL:
         ^~~~
xmlregexp.c:2837:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
      neg = !neg;
      ~~~~^~~~~~
xmlregexp.c:2838:9: note: here
         case XML_REGEXP_NOTREALCHAR:
         ^~~~
  CC       xmlschemas.lo
xmlschemas.c: In function 'xmlSchemaFormatItemForReport':
xmlschemas.c:327:31: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define FREE_AND_NULL(str) if ((str) != NULL) { xmlFree((xmlChar *) (str)); str = NULL; }
                               ^
xmlschemas.c:1743:3: note: in expansion of macro 'FREE_AND_NULL'
   FREE_AND_NULL(str);
   ^~~~~~~~~~~~~
xmlschemas.c:1745:2: note: here
  default:
  ^~~~~~~
  CC       xmlschemastypes.lo
xmlschemastypes.c: In function 'xmlSchemaValidateFacetInternal':
xmlschemastypes.c:5403:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if ((valType == XML_SCHEMAS_QNAME) ||
         ^
xmlschemastypes.c:5407:2: note: here
  case XML_SCHEMA_FACET_MAXLENGTH:
  ^~~~
  CC       xmlunicode.lo
  CC       xmlreader.lo
  CC       relaxng.lo
relaxng.c: In function 'xmlRelaxNGValidateValue':
relaxng.c:8890:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
             if (ret != 0) {
                ^
relaxng.c:8894:9: note: here
         case XML_RELAXNG_ZEROORMORE:{
         ^~~~
relaxng.c: In function 'xmlRelaxNGValidateState':
relaxng.c:10168:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
             if (ctxt->errNr > errNr)
                ^
relaxng.c:10171:9: note: here
         case XML_RELAXNG_ZEROORMORE:{
         ^~~~
  CC       dict.lo
dict.c: In function 'xmlDictAddString':
dict.c:252:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (pool->end - pool->free > namelen)
                             ^
dict.c: In function 'xmlDictAddQString':
dict.c:320:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (pool->end - pool->free > namelen + plen + 1)
                             ^
dict.c: In function 'xmlDictComputeFastKey':
dict.c:455:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 10: value += name[9];
                  ~~~~~~^~~~~~~~~~
dict.c:456:9: note: here
         case 9: value += name[8];
         ^~~~
dict.c:456:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 9: value += name[8];
                 ~~~~~~^~~~~~~~~~
dict.c:457:9: note: here
         case 8: value += name[7];
         ^~~~
dict.c:457:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 8: value += name[7];
                 ~~~~~~^~~~~~~~~~
dict.c:458:9: note: here
         case 7: value += name[6];
         ^~~~
dict.c:458:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 7: value += name[6];
                 ~~~~~~^~~~~~~~~~
dict.c:459:9: note: here
         case 6: value += name[5];
         ^~~~
dict.c:459:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 6: value += name[5];
                 ~~~~~~^~~~~~~~~~
dict.c:460:9: note: here
         case 5: value += name[4];
         ^~~~
dict.c:460:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 5: value += name[4];
                 ~~~~~~^~~~~~~~~~
dict.c:461:9: note: here
         case 4: value += name[3];
         ^~~~
dict.c:461:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 4: value += name[3];
                 ~~~~~~^~~~~~~~~~
dict.c:462:9: note: here
         case 3: value += name[2];
         ^~~~
dict.c:462:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 3: value += name[2];
                 ~~~~~~^~~~~~~~~~
dict.c:463:9: note: here
         case 2: value += name[1];
         ^~~~
dict.c: In function 'xmlDictComputeFastQKey':
dict.c:498:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 10: value += prefix[9];
                  ~~~~~~^~~~~~~~~~~~
dict.c:499:9: note: here
         case 9: value += prefix[8];
         ^~~~
dict.c:499:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 9: value += prefix[8];
                 ~~~~~~^~~~~~~~~~~~
dict.c:500:9: note: here
         case 8: value += prefix[7];
         ^~~~
dict.c:500:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 8: value += prefix[7];
                 ~~~~~~^~~~~~~~~~~~
dict.c:501:9: note: here
         case 7: value += prefix[6];
         ^~~~
dict.c:501:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 7: value += prefix[6];
                 ~~~~~~^~~~~~~~~~~~
dict.c:502:9: note: here
         case 6: value += prefix[5];
         ^~~~
dict.c:502:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 6: value += prefix[5];
                 ~~~~~~^~~~~~~~~~~~
dict.c:503:9: note: here
         case 5: value += prefix[4];
         ^~~~
dict.c:503:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 5: value += prefix[4];
                 ~~~~~~^~~~~~~~~~~~
dict.c:504:9: note: here
         case 4: value += prefix[3];
         ^~~~
dict.c:504:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 4: value += prefix[3];
                 ~~~~~~^~~~~~~~~~~~
dict.c:505:9: note: here
         case 3: value += prefix[2];
         ^~~~
dict.c:505:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 3: value += prefix[2];
                 ~~~~~~^~~~~~~~~~~~
dict.c:506:9: note: here
         case 2: value += prefix[1];
         ^~~~
dict.c:506:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 2: value += prefix[1];
                 ~~~~~~^~~~~~~~~~~~
dict.c:507:9: note: here
         case 1: value += prefix[0];
         ^~~~
dict.c:516:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 10: value += name[9];
                  ~~~~~~^~~~~~~~~~
dict.c:517:9: note: here
         case 9: value += name[8];
         ^~~~
dict.c:517:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 9: value += name[8];
                 ~~~~~~^~~~~~~~~~
dict.c:518:9: note: here
         case 8: value += name[7];
         ^~~~
dict.c:518:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 8: value += name[7];
                 ~~~~~~^~~~~~~~~~
dict.c:519:9: note: here
         case 7: value += name[6];
         ^~~~
dict.c:519:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 7: value += name[6];
                 ~~~~~~^~~~~~~~~~
dict.c:520:9: note: here
         case 6: value += name[5];
         ^~~~
dict.c:520:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 6: value += name[5];
                 ~~~~~~^~~~~~~~~~
dict.c:521:9: note: here
         case 5: value += name[4];
         ^~~~
dict.c:521:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 5: value += name[4];
                 ~~~~~~^~~~~~~~~~
dict.c:522:9: note: here
         case 4: value += name[3];
         ^~~~
dict.c:522:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 4: value += name[3];
                 ~~~~~~^~~~~~~~~~
dict.c:523:9: note: here
         case 3: value += name[2];
         ^~~~
dict.c:523:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 3: value += name[2];
                 ~~~~~~^~~~~~~~~~
dict.c:524:9: note: here
         case 2: value += name[1];
         ^~~~
dict.c:524:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         case 2: value += name[1];
                 ~~~~~~^~~~~~~~~~
dict.c:525:9: note: here
         case 1: value += name[0];
         ^~~~
  CC       SAX2.lo
  CC       xmlwriter.lo
xmlwriter.c: In function 'xmlTextWriterEndDTDEntity':
xmlwriter.c:3756:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
             sum += count;
             ~~~~^~~~~~~~
xmlwriter.c:3757:9: note: here
         case XML_TEXTWRITER_DTD_ENTY:
         ^~~~
  CC       legacy.lo
  CC       chvalid.lo
  CC       pattern.lo
  CC       xmlsave.lo
  CC       xmlmodule.lo
xmlmodule.c: In function 'xmlModulePlatformSymbol':
xmlmodule.c:348:13: warning: ISO C forbids assignment between function pointer and 'void *' [-Wpedantic]
     *symbol = GetProcAddress(handle, name);
             ^
  CC       schematron.lo
  CC       xzlib.lo
  CCLD     libxml2.la
  CC       testdso.lo
  CCLD     testdso.la
sed -e 's?\@XML_LIBDIR\@?-L/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib?g' \
    -e 's?\@XML_INCLUDEDIR\@?-I/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/libxml2?g' \
    -e 's?\@VERSION\@?2.9.6?g' \
    -e 's?\@XML_LIBS\@?-lxml2 -L/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib -lz -L/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib -llzma   -liconv   ?g' \
       < ./xml2Conf.sh.in > xml2Conf.tmp \
&& mv xml2Conf.tmp xml2Conf.sh
make[2]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6'
make[1]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/libxml2-2.9.6'



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]