Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1694

Warnings on gcc from xercesc/validators/schema/SchemaElementDecl.hpp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0
    • None
    • I see this warning on both Linux (x86 and amd64 with gcc-4.1.1) and Mac (Intel and PPC with gcc 4.0.x)

    Description

      Create a simple .cpp file

      #include <xercesc/validators/schema/SchemaElementDecl.hpp

      and compile it like so (adding Xerces-C to the include path if necessary with -I...)

      gcc -W -c tt.cpp

      I see:

      ...include/xercesc/validators/schema/SchemaElementDecl.hpp: In member function 'virtual bool xercesc_2_7::SchemaElementDecl::isGlobalDecl() const':
      ...include/xercesc/validators/schema/SchemaElementDecl.hpp:508: warning: comparison between signed and unsigned integer expressions

      I fixed it like this:

      $ p4 diff -du SchemaElementDecl.hpp
      ==== //3rdparty/tmw/xerces-c/src/xercesc/validators/schema/SchemaElementDecl.hpp#2 - /sandbox/greg/Amake/3p/sources/xerces-c/src/xercesc/validators/schema/SchemaElementDecl.hpp ====
      @@ -505,7 +505,7 @@

      inline bool SchemaElementDecl::isGlobalDecl() const

      { - return (fEnclosingScope == Grammar::TOP_LEVEL_SCOPE); + return (fEnclosingScope == static_cast<int>(Grammar::TOP_LEVEL_SCOPE)); }

      inline SchemaElementDecl*

      but you may want to fix it differently by getting all of the types here in alignment. I didn't see this warning in 2.6.

      Thanks for your time!
      Greg

      Attachments

        Activity

          People

            Unassigned Unassigned
            wolo Greg Wolodkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: