voutcn / megahit

Ultra-fast and memory-efficient (meta-)genome assembler
http://www.ncbi.nlm.nih.gov/pubmed/25609793
GNU General Public License v3.0
588 stars 134 forks source link

build warnings #242

Closed mathog closed 4 years ago

mathog commented 4 years ago

Greetings. On CentOS 7 today this happened:

  git clone https://github.com/voutcn/megahit.git
  cd megahit
  git submodule update --init
  cmake .. -DCMAKE_BUILD_TYPE=Release
  make -j4 2>&1 | tee build_2019_09_26.log
  #some worrying warnings appear, like:
  #/usr/common/src/megahit/src/sequence/kmer.h:153:24: warning: array subscript is above array bounds [-Warray-bounds]
  #     data_[i] = (data_[i] >> 2) | (data_[i - 1] << (kBitsPerWord - 2));

I don't know if these actually affect a program run, but the compiler thinks there is an issue. These appear with g++ 4.8.5 or 7.3.1.

Also, while an initial "make" runs to completion, subsequent runs exit with an error, even after doing a "make clean".

mathog commented 4 years ago

Sorry, the preceding omitted the

mkdir build
cd build

lines before "cmake". They were done, I just cut and pasted wrong.

voutcn commented 4 years ago

I saw this when using some versions of g++ too. It is not a problem.