Add support for QNX & Fix xmltest UB
As the title says. Almost same as https://github.com/leethomason/tinyxml2/pull/988, but fix undefined behavior in xmltest. https://github.com/leethomason/tinyxml2/pull/988 can be closed since this fix is a generalization of it.
That seems to make sense on the surface, but why are nulls coming back? Most things will crash on null pointers being printed.
#include <stdio.h>
int main(int argc, char** argv)
{
printf("%s", NULL);
return 0;
}
This simple test program will output (null) on Debian 13 with GCC 14.2.0.
7.1.4 Use of library functions. Each of the following statements applies unless explicitly stated otherwise in the detailed descriptions that follow: If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or a pointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined.
printf(...) on null pointer is undefined, hence there is no specification saying it should result in any kinds of failure.