0

This is my Makefile

gcc --coverage -c ../file.c -o file.o
gcc --coverage ut1.c -o ut1 file.o -lcmocka
gcc --coverage ut2.c ../file.c -o ut2 -lcmocka
./ut2
./ut1
gcov -bc file.gcda file.gcno

Output :-

file.gcda:stamp mismatch with notes file
file.gcda:stamp mismatch with notes file
File '../file.c'
No executable lines
No branches
No calls
Removing 'file.c.gcov'

No executable lines

My understanding is that when we compile file.c then file.o and file.gcno get created when ut2 is compiled then gcno is overwritten , so its should be the case of partial coverage , but i am getting stamp mismatch with note file . can anyone explain what is note file and what does it actually mean by stamp mismatch .

Also if i change the order ut execution i am getting coverage !

gcc --coverage -c ../file.c -o file.o
gcc --coverage ut1.c -o ut1 file.o -lcmocka
gcc --coverage ut2.c ../file.c -o ut2 -lcmocka
./ut1
./ut2
gcov -bc file.gcda file.gcno
amon
  • 57,091
  • 2
  • 89
  • 149
Learner09
  • 9
  • 1
  • 5
  • This is exactly the same issue as in your [previous question](https://stackoverflow.com/q/68136230). The `./ut2` produces a .gcda in version 2, `./ut1` overwrites it (with a warning) with a .gcda in version 1. However, the file.gcno is from version 2, thus the mismatch when you run `gcov`. – amon Jul 14 '21 at 12:58
  • earlier the issue was partial coverage because of overwrite but there coverage is not happening .. pls explain what is note file and stamp miss match as nowhere these informaton given properly PLEASE ELABORATE your answer its will be beneficial for everyone – Learner09 Jul 14 '21 at 13:16
  • @amon can you please explain your answer it will be beneficial for me and everyone . pls explain what is notefile stamp and overwrting – Learner09 Jul 14 '21 at 14:36

0 Answers0