commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.6k stars 534 forks source link

Cannot compile with `-ftest-coverage` #478

Closed Mech0n closed 1 year ago

Mech0n commented 1 year ago

Cannot compile with -ftest-coverage

CC="gcc -fprofile-arcs -ftest-coverage" CXX="g++ -fprofile-arcs -ftest-coverage" cmake ..
make

stuck at building src/CMakeFiles/cmark_static.dir/scanners.c.o

[  2%] Building C object src/CMakeFiles/cmark_static.dir/scanners.c.o
jgm commented 1 year ago

I can't reproduce this. It builds fine for me with this command. (Is there something unusual about your system, e.g. low memory?)

Mech0n commented 1 year ago

I have enough memory. and this is my gcc version, i installed two gcc:

gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0
gcc-8 (Ubuntu 8.4.0-3ubuntu2) 8.4.0

➜  ~ gcov --version
gcov (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
nwellnhof commented 1 year ago

Probably a GCC bug, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66209 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64928

Mech0n commented 1 year ago

thx @nwellnhof , I build a gcc 12, and build cmark success.