SimonKagstrom / kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
http://simonkagstrom.github.io/kcov/
GNU General Public License v2.0
710 stars 109 forks source link

Fix build on gcc-13: add missing <stdint.h> include #384

Closed trofi closed 1 year ago

trofi commented 2 years ago

[ 15%] Building CXX object src/CMakeFiles/kcov.dir/writers/cobertura-writer.cc.o In file included from kcov/src/writers/cobertura-writer.cc:6: kcov/src/include/reporter.hh:24:90: error: 'uint64_t' has not been declared 24 | LineExecutionCount(unsigned int hits, unsigned int possibleHits, uint64_t order) : | ^~~~

SimonKagstrom commented 1 year ago

Great, thanks!

glebfm commented 1 year ago

I believe the <cstdint> header would be more appropriate for C++ code.

SimonKagstrom commented 1 year ago

Yes, you are right @glebfm. However, kcov would also be good to port to a modern C++ variant. It's currently C++03, but at least C++17 should be available on basically all systems which kcov runs on.

trofi commented 1 year ago

One minor note: if you plan to switch to from <stdint.h> to <cstdint> you might need to make sure you are using std::unit64_t (instead of unit64_t) as standard only guarantees to provide them out of std:: namespace.