Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
2.8.0
-
None
Description
SchemaAttDef.hpp and SchemaElementDecl.hpp both trigger warnings under -Wall with g++ 4.7.2. In our environment, since we use -Werror for validation, these become a more serious issue.
There are 2 categories of fixes - a signed/unsigned comparison mismatch in SchemaElementDecl::isGlobalDecl, and some missing parens in if statements in SchemaAttDef::getMemberTypeAnonymous() and bool SchemaElementDecl::isTypeDefinitionUnion().
Here's a patch:
—
src/xercesc/validators/schema/SchemaAttDef.hpp | 4 ++--
src/xercesc/validators/schema/SchemaElementDecl.hpp | 6 +++---
2 files changed, 5 insertions, 5 deletions
diff --git a/src/xercesc/validators/schema/SchemaAttDef.hpp b/src/xercesc/validators/schema/SchemaAttDef.hpp
index 7648de0..2c069b7 100644
— a/src/xercesc/validators/schema/SchemaAttDef.hpp
+++ b/src/xercesc/validators/schema/SchemaAttDef.hpp
@@ -401,8 +401,8 @@ inline bool SchemaAttDef::getMemberTypeAnonymous() const {
}
inline bool SchemaAttDef::isTypeDefinitionUnion() const
{ - if(fAnyDatatypeValidator && fAnyDatatypeValidator->getType() == DatatypeValidator::Union || - fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union) + if( (fAnyDatatypeValidator && fAnyDatatypeValidator->getType() == DatatypeValidator::Union) + || (fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)) return true; return false; }diff --git a/src/xercesc/validators/schema/SchemaElementDecl.hpp b/src/xercesc/validators/schema/SchemaElementDecl.hpp
index 9ffc2f2..5f9ad8f 100644
— a/src/xercesc/validators/schema/SchemaElementDecl.hpp
+++ b/src/xercesc/validators/schema/SchemaElementDecl.hpp
@@ -506,7 +506,7 @@ inline SchemaAttDef* SchemaElementDecl::getAttWildCard() {
inline bool SchemaElementDecl::isGlobalDecl() const
{ - return (fEnclosingScope == Grammar::TOP_LEVEL_SCOPE); + return (static_cast<unsigned int>(fEnclosingScope) == Grammar::TOP_LEVEL_SCOPE); } inline SchemaElementDecl*
@@ -591,8 +591,8 @@ inline bool SchemaElementDecl::getMemberTypeAnonymous() const {
inline bool SchemaElementDecl::isTypeDefinitionUnion() const
–