From: Bruno Haible Date: Fri, 26 May 2023 15:07:04 +0000 (+0200) Subject: libxml: Silence several gcc warnings. X-Git-Tag: v0.22~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a53330559c981639f238d8b7810a25f0b277a276;p=thirdparty%2Fgettext.git libxml: Silence several gcc warnings. * gnulib-local/lib/libxml/SAX2.c (xmlNsErrMsg): Mark as possibly unused. (xmlSAX2AttributeDecl, xmlSAX2ElementDecl, xmlSAX2NotationDecl): Mark a local variable as possibly unused. * gnulib-local/lib/libxml/encoding.c (xmlCharEncCloseFunc): Likewise. * gnulib-local/lib/libxml/trionan.c (compute_minus_zerod, minus_zerod): Mark as possibly unused. * gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Use a differently typed variable cloneAttr. --- diff --git a/gnulib-local/lib/libxml/SAX2.c b/gnulib-local/lib/libxml/SAX2.c index e52467ec7..c9f241b89 100644 --- a/gnulib-local/lib/libxml/SAX2.c +++ b/gnulib-local/lib/libxml/SAX2.c @@ -1,5 +1,5 @@ /* libxml2 - Library for parsing XML documents - * Copyright (C) 2006-2019 Free Software Foundation, Inc. + * Copyright (C) 2006-2023 Free Software Foundation, Inc. * * This file is not part of the GNU gettext program, but is used with * GNU gettext. @@ -218,6 +218,7 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, * * Handle a namespace error */ +_GL_ATTRIBUTE_MAYBE_UNUSED static void LIBXML_ATTR_FORMAT(3,0) xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) @@ -764,7 +765,7 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, xmlEnumerationPtr tree) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlAttributePtr attr; + _GL_ATTRIBUTE_MAYBE_UNUSED xmlAttributePtr attr; xmlChar *name = NULL, *prefix = NULL; if ((ctxt == NULL) || (ctxt->myDoc == NULL)) @@ -831,7 +832,7 @@ xmlSAX2ElementDecl(void *ctx, const xmlChar * name, int type, xmlElementContentPtr content) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlElementPtr elem = NULL; + _GL_ATTRIBUTE_MAYBE_UNUSED xmlElementPtr elem = NULL; if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return; @@ -877,7 +878,7 @@ xmlSAX2NotationDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlNotationPtr nota = NULL; + _GL_ATTRIBUTE_MAYBE_UNUSED xmlNotationPtr nota = NULL; if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return; diff --git a/gnulib-local/lib/libxml/encoding.c b/gnulib-local/lib/libxml/encoding.c index af31ae444..d7f2310b5 100644 --- a/gnulib-local/lib/libxml/encoding.c +++ b/gnulib-local/lib/libxml/encoding.c @@ -1,5 +1,5 @@ /* libxml2 - Library for parsing XML documents - * Copyright (C) 2006-2019 Free Software Foundation, Inc. + * Copyright (C) 2006-2023 Free Software Foundation, Inc. * * This file is not part of the GNU gettext program, but is used with * GNU gettext. @@ -2749,7 +2749,8 @@ int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { int ret = 0; int tofree = 0; - int i, handler_in_list = 0; + int i; + _GL_ATTRIBUTE_MAYBE_UNUSED int handler_in_list = 0; if (handler == NULL) return(-1); if (handler->name == NULL) return(-1); diff --git a/gnulib-local/lib/libxml/tree.c b/gnulib-local/lib/libxml/tree.c index 56527623f..0c3f792b0 100644 --- a/gnulib-local/lib/libxml/tree.c +++ b/gnulib-local/lib/libxml/tree.c @@ -1,5 +1,5 @@ /* libxml2 - Library for parsing XML documents - * Copyright (C) 2006-2019 Free Software Foundation, Inc. + * Copyright (C) 2006-2023 Free Software Foundation, Inc. * * This file is not part of the GNU gettext program, but is used with * GNU gettext. @@ -9514,25 +9514,25 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, /* * Attributes (xmlAttr). */ - clone = (xmlNodePtr) xmlMalloc(sizeof(xmlAttr)); - if (clone == NULL) { + xmlAttrPtr cloneAttr = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); + if (cloneAttr == NULL) { xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node"); goto internal_error; } - memset(clone, 0, sizeof(xmlAttr)); + memset(cloneAttr, 0, sizeof(xmlAttr)); /* * Set hierachical links. * TODO: Change this to add to the end of attributes. */ if (resultClone != NULL) { - clone->parent = parentClone; + cloneAttr->parent = parentClone; if (prevClone) { - prevClone->next = clone; - clone->prev = prevClone; + prevClone->next = (xmlNodePtr) cloneAttr; + cloneAttr->prev = (xmlAttrPtr) prevClone; } else - parentClone->properties = (xmlAttrPtr) clone; + parentClone->properties = (xmlAttrPtr) cloneAttr; } else - resultClone = clone; + resultClone = (xmlNodePtr) cloneAttr; break; default: /* diff --git a/gnulib-local/lib/libxml/trionan.c b/gnulib-local/lib/libxml/trionan.c index dcd277049..55182ffe7 100644 --- a/gnulib-local/lib/libxml/trionan.c +++ b/gnulib-local/lib/libxml/trionan.c @@ -1,5 +1,5 @@ /* NaNs and Infinity in floating-point numbers. - Copyright (C) 2015-2019 Free Software Foundation, Inc. + Copyright (C) 2015-2023 Free Software Foundation, Inc. This file was written by Daiki Ueno , 2015. @@ -64,6 +64,7 @@ NaNd () The expression -DBL_MIN * DBL_MIN does not work when cross-compiling to PowerPC on Mac OS X 10.5. */ #if defined __hpux || defined __sgi || defined __ICC +_GL_ATTRIBUTE_MAYBE_UNUSED static double compute_minus_zerod (void) { @@ -71,6 +72,7 @@ compute_minus_zerod (void) } # define minus_zerod compute_minus_zerod () #else +_GL_ATTRIBUTE_MAYBE_UNUSED static double minus_zerod = -0.0; #endif