> +               line = XML_GetCurrentLineNumber(p);

I think you can simplify your larger diff and avoid the temporary variable
by doing:

                       warnx("%s: XML error at line %llu: %s", s->local,
                           (unsigned long long)XML_GetCurrentLineNumber(p),
                           XML_ErrorString(XML_GetErrorCode(s->parser)));

This is the explicit upcast model we use for a similar problem: time_t

The benefit of doing the upcast directly in front of the function call
rather than defining a temporary variable with implicit upcast, became
clear during our time_t conversion process: we saw developers creating
implicit upcast temporary variables, and then passing the temporary time
variables (with a different type) to more than printf related code.
That felt wrong.  We wanted to aovid breaking the non-64bit time_t use
cases of the code.  Carrying time values in non-time_t types felt wrong, so
we preferred keeping the values in the correct type until the last moment,
hence (explicit cast)function() just for the "%llu".

Reply via email to