https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122398

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
`const xmlError* msg = ...;` is strictly better anyway, because the next line
only reads the values from msg, so it's more const correct to make it read
only.

--- a/libgcobol/xmlparse.cc
+++ b/libgcobol/xmlparse.cc
@@ -582,7 +582,7 @@ __gg__xml_parse(  const cblc_field_t *input_field,
   int erc = xmlSAXUserParseMemory(&handlers, nullptr, input, len);

   if( erc ) {
-    xmlErrorPtr        msg = xmlCtxtGetLastError(nullptr);
+    const xmlError* msg = xmlCtxtGetLastError(nullptr);
     fprintf(stderr, "XML PARSE: error: line %d: %s (%d: %d.%d.%d)\n",
             msg->line, msg->message, erc, msg->domain, msg->level, msg->code);
   }

Reply via email to