Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-3803

Fix Qserv compiler warnings with clang

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Qserv
    • Labels:
      None

      Description

      Qserv triggers numerous warnings with clang on OS X. Full details are in the attached ticket, here we summarize the distinct warnings classes:

      Protobuf

      /Users/timj/work/lsstsw/stack/DarwinX86/protobuf/2.6.1+fbf04ba888/include/google/protobuf/unknown_field_set.h:214:13: warning: anonymous types declared in an anonymous union
            are an extension [-Wnested-anon-types]
          mutable union {
                  ^
      

      Qserv

      In file included from core/modules/sql/statement.cc:32:
      core/modules/sql/Schema.h:74:1: warning: 'Schema' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct Schema {
      ^
      core/modules/sql/statement.h:35:1: note: did you mean struct here?
      class Schema; // Forward
      ^~~~~
      struct
      

      core/modules/proto/WorkerResponse.h:34:1: warning: 'WorkerResponse' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct WorkerResponse {
      ^
      core/modules/ccontrol/MergingRequester.h:38:3: note: did you mean struct here?
        class WorkerResponse;
        ^~~~~
        struct
      

      In file included from core/modules/qana/QueryMapping.cc:46:
      core/modules/qproc/ChunkSpec.h:51:1: warning: 'ChunkSpec' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct ChunkSpec {
      ^
      core/modules/qana/QueryMapping.h:44:5: note: did you mean struct here?
          class ChunkSpec;
          ^~~~~
          struct
      

      core/modules/qana/TableInfo.h:186:1: warning: 'DirTableInfo' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct DirTableInfo : TableInfo {
      ^
      core/modules/qana/TableInfo.h:86:1: note: did you mean struct here?
      class DirTableInfo;
      ^~~~~
      struct
      core/modules/qana/TableInfo.h:221:1: warning: 'ChildTableInfo' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct ChildTableInfo : TableInfo {
      ^
      core/modules/qana/TableInfo.h:87:1: note: did you mean struct here?
      class ChildTableInfo;
      ^~~~~
      struct
      core/modules/qana/TableInfo.h:260:1: warning: 'MatchTableInfo' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct MatchTableInfo : TableInfo {
      ^
      core/modules/qana/TableInfo.h:88:1: note: did you mean struct here?
      class MatchTableInfo;
      ^~~~~
      struct
      In file included from core/modules/qana/ColumnVertexMap.cc:36:
      core/modules/qana/RelationGraph.h:513:1: warning: struct 'Vertex' was previously declared as a class [-Wmismatched-tags]
      struct Vertex;
      ^
      core/modules/qana/ColumnVertexMap.h:44:7: note: previous use is here
      class Vertex;
            ^
      In file included from core/modules/qana/ColumnVertexMap.cc:36:
      core/modules/qana/RelationGraph.h:547:1: warning: 'Vertex' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct Vertex {
      ^
      core/modules/qana/ColumnVertexMap.h:44:1: note: did you mean struct here?
      class Vertex;
      ^~~~~
      struct
      

      core/modules/wbase/Base.h:72:1: warning: 'ScriptMeta' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct ScriptMeta {
      ^
      core/modules/wbase/Task.h:41:5: note: did you mean struct here?
          class ScriptMeta;
          ^~~~~
          struct
      

      In file included from core/modules/parser/BoolTermFactory.cc:46:
      core/modules/query/Predicate.h:86:27: warning: 'lsst::qserv::query::GenericPredicate::putStream' hides overloaded virtual function [-Woverloaded-virtual]
          virtual std::ostream& putStream(std::ostream& os) = 0;
                                ^
      core/modules/query/Predicate.h:71:27: note: hidden overloaded virtual function 'lsst::qserv::query::Predicate::putStream' declared here: different qualifiers (const vs none)
          virtual std::ostream& putStream(std::ostream& os) const = 0;
                                ^
      

      core/modules/parser/FromFactory.cc:62:15: warning: unused function 'walkToSiblingBefore' [-Wunused-function]
      inline RefAST walkToSiblingBefore(RefAST node, int typeId) {
                    ^
      core/modules/parser/FromFactory.cc:72:1: warning: unused function 'getSiblingStringBounded' [-Wunused-function]
      getSiblingStringBounded(RefAST left, RefAST right) {
      ^
      

      In file included from core/modules/wsched/ChunkDisk.cc:25:
      core/modules/wsched/ChunkDisk.h:130:10: warning: private field '_completed' is not used [-Wunused-private-field]
          bool _completed;
               ^
      

      In file included from core/modules/parser/PredicateFactory.cc:45:
      core/modules/query/Predicate.h:86:27: warning: 'lsst::qserv::query::GenericPredicate::putStream' hides overloaded virtual function [-Woverloaded-virtual]
          virtual std::ostream& putStream(std::ostream& os) = 0;
                                ^
      core/modules/query/Predicate.h:71:27: note: hidden overloaded virtual function 'lsst::qserv::query::Predicate::putStream' declared here: different qualifiers (const vs none)
          virtual std::ostream& putStream(std::ostream& os) const = 0;
                                ^
      

      core/modules/parser/WhereFactory.cc:265:31: warning: binding reference member 'c' to stack allocated parameter 'c_' [-Wdangling-field]
          PrintExcept(Check c_) : c(c_) {}
                                    ^~
      core/modules/parser/WhereFactory.cc:291:28: note: in instantiation of member function 'lsst::qserv::parser::PrintExcept<lsst::qserv::parser::MetaCheck>::PrintExcept' requested
            here
          PrintExcept<MetaCheck> p(mc);
                                 ^
      core/modules/parser/WhereFactory.cc:269:12: note: reference member declared here
          Check& c;
                 ^
      

      core/modules/rproc/ProtoRowBuffer.cc:44:11: warning: unused variable 'largeRowThreshold' [-Wunused-const-variable]
      int const largeRowThreshold = 500*1024;
                ^
      

      core/modules/util/testIterableFormatter.cc:85:43: warning: suggest braces around initialization of subobject [-Wmissing-braces]
          std::array<std::string, 6> iterable { "1", "2", "3", "4", "5", "6"};
                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                {                           }
      

      In file included from core/modules/qdisp/XrdSsiMocks.cc:37:
      core/modules/qdisp/XrdSsiMocks.h:64:16: warning: private field '_executive' is not used [-Wunused-private-field]
          Executive *_executive;
                     ^
      

      core/modules/xrdoss/QservOss.cc:77:1: warning: unused function 'print' [-Wunused-function]
      print(std::ostream& os, lsst::qserv::xrdoss::QservOss::StringSet const& h) {
      ^
      

      OS X

      core/modules/qdisp/QueryRequest.h:54:25: warning: 'lsst::qserv::qdisp::BadResponseError::what' hides overloaded virtual function [-Woverloaded-virtual]
          virtual char const* what() throw() {
                              ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:95:25: note: hidden overloaded virtual function
            'std::exception::what' declared here: different qualifiers (const vs none)
          virtual const char* what() const _NOEXCEPT;
                              ^
      In file included from core/modules/qdisp/Executive.cc:64:
      In file included from core/modules/qdisp/XrdSsiMocks.h:37:
      core/modules/qdisp/QueryRequest.h:67:25: warning: 'lsst::qserv::qdisp::RequestError::what' hides overloaded virtual function [-Woverloaded-virtual]
          virtual char const* what() throw() {
                              ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:95:25: note: hidden overloaded virtual function
            'std::exception::what' declared here: different qualifiers (const vs none)
          virtual const char* what() const _NOEXCEPT;
                              ^
      

      core/modules/proto/TaskMsgDigest.cc:55:5: warning: 'MD5' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
          MD5(reinterpret_cast<unsigned char const*>(str.data()),
          ^
      /usr/include/openssl/md5.h:116:16: note: 'MD5' has been explicitly marked deprecated here
      unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
                     ^
      

      core/modules/util/StringHash.cc:78:24: warning: 'SHA1' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
          return wrapHashHex<SHA1, SHA_DIGEST_LENGTH>(buffer, bufferSize);
                             ^
      /usr/include/openssl/sha.h:124:16: note: 'SHA1' has been explicitly marked deprecated here
      unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
                     ^
      core/modules/util/StringHash.cc:83:24: warning: 'SHA256' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
          return wrapHashHex<SHA256, SHA256_DIGEST_LENGTH>(buffer, bufferSize);
                             ^
      /usr/include/openssl/sha.h:150:16: note: 'SHA256' has been explicitly marked deprecated here
      unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
                     ^
      

      Xrootd

      In file included from core/modules/qdisp/Executive.cc:64:
      In file included from core/modules/qdisp/XrdSsiMocks.h:33:
      In file included from /Users/timj/work/lsstsw/stack/DarwinX86/xrootd/u.timj.DM-3584-ge22410fa7f+da39a3ee5e/include/xrootd/XrdSsi/XrdSsiRequest.hh:37:
      /Users/timj/work/lsstsw/stack/DarwinX86/xrootd/u.timj.DM-3584-ge22410fa7f+da39a3ee5e/include/xrootd/XrdSsi/XrdSsiRespInfo.hh:43:1: warning: 'XrdSsiRespInfo' defined as a
            struct here but previously declared as a class [-Wmismatched-tags]
      struct  XrdSsiRespInfo
      ^
      /Users/timj/work/lsstsw/stack/DarwinX86/xrootd/u.timj.DM-3584-ge22410fa7f+da39a3ee5e/include/xrootd/XrdSsi/XrdSsiSession.hh:45:1: note: did you mean struct here?
      class XrdSsiRespInfo;
      ^~~~~
      struct
      

      core/modules/xrdoss/QservOss.h:64:17: warning: 'lsst::qserv::xrdoss::FakeOssDf::Opendir' hides overloaded virtual function [-Woverloaded-virtual]
          virtual int Opendir(const char *) { return XrdOssOK; }
                      ^
      /Users/timj/work/lsstsw/stack/DarwinX86/xrootd/u.timj.DM-3584-ge22410fa7f+da39a3ee5e/include/xrootd/XrdOss/XrdOss.hh:63:17: note: hidden overloaded virtual function
            'XrdOssDF::Opendir' declared here: different number of parameters (2 vs 1)
      virtual int     Opendir(const char *, XrdOucEnv &)           {return -ENOTDIR;}
                      ^
      

      In file included from core/modules/xrdsvc/SsiSession.h:32:
      /Users/timj/work/lsstsw/stack/DarwinX86/xrootd/u.timj.DM-3584-ge22410fa7f+da39a3ee5e/include/xrootd/XrdSsi/XrdSsiResponder.hh:177:27: warning: control may reach end of
            non-void function [-Wreturn-type]
                                }
                                ^
      

      boost

      /Users/timj/work/lsstsw/stack/DarwinX86/boost/1.55.0.1.lsst2+fbf04ba888/include/boost/regex/v4/regex_raw_buffer.hpp:132:7: warning: 'register' storage class specifier is
            deprecated [-Wdeprecated-register]
            register pointer result = end;
            ^~~~~~~~~
      

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  fritzm Fritz Mueller
                  Reporter:
                  tjenness Tim Jenness
                  Reviewers:
                  Tim Jenness
                  Watchers:
                  Andy Hanushevsky, Andy Salnikov, Fritz Mueller, Jacek Becla, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel