In the copy of tinyxml added by John E. to the mingw-get repository,
I see (with white space condensed) the following change from a copy
of the upstream source:
--- tinyxml-upstream/tinyxmlparser.cpp ...
+++ mingw-get/tinyxml/tinyxmlparser.cpp ...
@@ -22,6 +22,10 @@
+/* Modified: JohnE, 2008-08-09
+ * Add parentheses to fix GCC -Wall warning
@@ -354,7 +358,7 @@
- while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' )
+ while ( (*p && IsWhiteSpace( *p )) || *p == '\n' || *p =='\r' )
I don't see that warning, either with MinGW g++-3.4.5 or with Ubuntu
g++-4.2.4, but I guess it is present with later g++. The original
logic is certainly (perhaps harmlessly) ambiguous, but surely the
intended expression would be:
while( *p && (IsWhiteSpace( *p ) || *p == '\n' || *p == '\r') )
or, since IsWhiteSpace() is defined as:
inline static bool IsWhiteSpace( char c )
return (isspace( (unsigned char) c ) || c == '\n' || c == '\r');
(doesn't isspace() return true for '\n' and '\r' anyway?) wouldn't
while( *p && IsWhiteSpace( *p ) )
John, have you raised this issue with the tinyxml folks?