David Bertoni wrote:
> Mateusz Loskot wrote:
>> 
>> Am I doing anything wrong here?
> 
> I don't think so.  I looks like your platform has defined "not" as a 
> macro for  "!" and that's causing problems with the local variable 
> "not."  What platform and compiler are you using?

GNU/Linux, Ubuntu 6.10
$ gcc --version
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)

> What happens if you rename that variable to something else?

Yes, it works.
I renamed not to notation and it compiles now.

See attached diff file.

> We should modify the offending source code to use a better variable
> name than "not," for better compatibility.

Yes, it is a reserved keyword by C++ standard,
according to chapter 2.11 Keywords, Table 4: alternative representations.

Thanks for you help!

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net
mloskot:~/dev/apache/xerces/_svn/trunk$ svn diff src/xercesc/xinclude/XIncludeUtils.cpp 
Index: src/xercesc/xinclude/XIncludeUtils.cpp
===================================================================
--- src/xercesc/xinclude/XIncludeUtils.cpp      (revision 532400)
+++ src/xercesc/xinclude/XIncludeUtils.cpp      (working copy)
@@ -316,7 +316,7 @@
                         if(typeInfo && XMLString::equals(typeInfo->getTypeNamespace(), XMLUni::fgInfosetURIName)) {
                             if(XMLString::equals(typeInfo->getTypeName(), XMLUni::fgNotationString)) {
                                 const XMLCh* notationName=pAttributeNode->getNodeValue();
-                                DOMNotation* not=(DOMNotation*)includedDoc->getDoctype()->getNotations()->getNamedItem(notationName);
+                                DOMNotation* notation=(DOMNotation*)includedDoc->getDoctype()->getNotations()->getNamedItem(notationName);
                                 // ensure we have a DTD
                                 if(parsedDocument->getDoctype()==NULL)
                                     parsedDocument->insertBefore(parsedDocument->createDocumentType(parsedDocument->getDocumentElement()->getNodeName(), NULL,NULL), parsedDocument->getFirstChild());
@@ -324,11 +324,11 @@
                                 if(myNotation==NULL)
                                 {
                                     // it's missing, add it
-                                    parsedDocument->getDoctype()->getNotations()->setNamedItem(parsedDocument->importNode(not, true));
+                                    parsedDocument->getDoctype()->getNotations()->setNamedItem(parsedDocument->importNode(notation, true));
                                 }
-                                else if(XMLString::equals(myNotation->getPublicId(), not->getPublicId()) && 
-                                        XMLString::equals(myNotation->getSystemId(), not->getSystemId()) && 
-                                        XMLString::equals(myNotation->getBaseURI(), not->getBaseURI()))
+                                else if(XMLString::equals(myNotation->getPublicId(), notation->getPublicId()) && 
+                                        XMLString::equals(myNotation->getSystemId(), notation->getSystemId()) && 
+                                        XMLString::equals(myNotation->getBaseURI(), notation->getBaseURI()))
                                 {
                                     // it's duplicate, ignore it
                                 }

Reply via email to