fmihpc/vlsv

Compilation warnings

Closed this issue · 2 comments

I get these when compiling vlsv_reader_parallel.cpp with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn):

In file included from vlsv_reader_parallel.cpp:24:
./vlsv_reader_parallel.h:38:12: warning: 'vlsv::ParallelReader::getArrayInfo' hides overloaded virtual function [-Woverloaded-virtual]
      bool getArrayInfo(const std::string& tagName,const std::list<std::pair<std::string,std::string> >& attribs,
           ^
./vlsv_reader.h:40:20: note: hidden overloaded virtual function 'vlsv::Reader::getArrayInfo' declared here: different qualifiers
      (const vs none)
      virtual bool getArrayInfo(const std::string& tagName,const std::list<std::pair<std::string,std::string> >& attribs,
                   ^
In file included from vlsv_reader_parallel.cpp:24:
./vlsv_reader_parallel.h:45:12: warning: 'vlsv::ParallelReader::open' hides overloaded virtual function [-Woverloaded-virtual]
      bool open(const std::string& fname,MPI_Comm comm,const int& masterRank,MPI_Info mpiInfo=MPI_INFO_NULL);
           ^
./vlsv_reader.h:45:20: note: hidden overloaded virtual function 'vlsv::Reader::open' declared here: different number of parameters
      (1 vs 4)
      virtual bool open(const std::string& fname);
                   ^
In file included from vlsv_reader_parallel.cpp:24:
./vlsv_reader_parallel.h:74:12: warning: 'vlsv::ParallelReader::getArrayInfo' hides overloaded virtual function [-Woverloaded-virtual]
      bool getArrayInfo(const std::string& tagName,const std::list<std::pair<std::string,std::string> >& attribs);
           ^
./vlsv_reader.h:40:20: note: hidden overloaded virtual function 'vlsv::Reader::getArrayInfo' declared here: different number of
      parameters (6 vs 2)
      virtual bool getArrayInfo(const std::string& tagName,const std::list<std::pair<std::string,std::string> >& attribs,
                   ^

I'm not sure how big of a problem these could be but there's probably a reason why clang warns about them.

I took a look at these: only the first warning seems to be relevant, I removed const qualifier from base class since the corresponsing functions in ParallelReader cannot be const. Changes in #13

Fixed and merged to master, closing issue.