arq5x / bedtools2

bedtools - the swiss army knife for genome arithmetic
MIT License
941 stars 287 forks source link

Does not compile in gcc 13.2.1 #1068

Closed balwierz closed 1 year ago

balwierz commented 1 year ago

I am using Arch Linux and have gcc 13.2.1 It does not compile with the following errors:

$ make
Building BEDTools:
=========================================================
CXXFLAGS is [-g -Wall -O2 -std=c++11 ]
DETECTED_VERSION = v2.31.0
CURRENT_VERSION  = v2.31.0
  * compiling src/fisher/fisherHelp.cpp
  * compiling src/mapFile/mapHelp.cpp
  * compiling src/utils/general/ParseTools.cpp
In file included from src/utils/general/ParseTools.cpp:1:
src/utils/general/ParseTools.h: In function ‘void int2str(U, T&, bool)’:
src/utils/general/ParseTools.h:57:9: error: ‘uint32_t’ was not declared in this scope
   57 |         uint32_t n;
      |         ^~~~~~~~
src/utils/general/ParseTools.h:19:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   18 | #include <cstdlib>
  +++ |+#include <cstdint>
   19 | 
src/utils/general/ParseTools.h:58:13: error: ‘n’ was not declared in this scope
   58 |         for(n = 0; number; number /= 10)
      |             ^
src/utils/general/ParseTools.h:60:28: error: ‘n’ was not declared in this scope
   60 |         if(neg) tmp[12 - ++n] = '-';
      |                            ^
src/utils/general/ParseTools.h:62:50: error: ‘n’ was not declared in this scope
   62 |         if(appendToBuf) buffer.append(tmp + 12 - n, n);
      |                                                  ^
src/utils/general/ParseTools.h:63:39: error: ‘n’ was not declared in this scope
   63 |         else buffer.assign(tmp + 12 - n, n);
      |                                       ^
src/utils/general/ParseTools.cpp: In function ‘bool isHeaderLine(const std::string&)’:
src/utils/general/ParseTools.cpp:105:17: error: ‘uint32_t’ was not declared in this scope
  105 |                 uint32_t peek = *(uint32_t*)line.c_str() | 0x20202020u;
      |                 ^~~~~~~~
src/utils/general/ParseTools.cpp:8:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    7 | #include <sstream>
  +++ |+#include <cstdint>
    8 | 
src/utils/general/ParseTools.cpp:109:24: error: ‘peek’ was not declared in this scope
  109 |                 switch(peek) {
      |                        ^~~~
make: *** [src/utils/general/Makefile.frag:4: obj/ParseTools.o] Error 1
balwierz commented 1 year ago

You may want to have a look at this commit from another project: https://github.com/adelton/edgetx/commit/e1144282500b0284c4691b257213801facc1a205

jmarshall commented 1 year ago

Duplicate of #1056; fixed by PR #1067 et al.

arq5x commented 1 year ago

fixed with PR #1067