linux-test-project / lcov

LCOV
GNU General Public License v2.0
866 stars 234 forks source link

warning "GCOV did not produce any data" misclassified/not useful #258

Closed petere closed 4 months ago

petere commented 6 months ago

The warning "GCOV did not produce any data" in geninfo is classified as $ERROR_GCOV ("gcov"). This warning/error category is documented as "the gcov tool returned with a non-zero return code." But that is not what is happening here. In this case, gcov ran fine, but geninfo had something to say about its output. I would like to ignore this warning, but I don't want to ignore all gcov errors. So this should be a different category (maybe under "empty").

However, I think this warning isn't useful at all. It is perfectly okay for a C file to not have any functions. So maybe this warning should be removed altogether.

henry2cox commented 6 months ago

I'm somewhat reluctant to change message categorizations - particularly in this area - as it is very likely to disrupt some existing users. That said: I would prefer to not be the sole arbiter of usability, and would prefer input/opinions from other users to know what they would prefer. Either way: it would probably be a good idea to update the documentation to be a bit more clear.

With respect to C files without functions: yes. Perfectly legal, perfectly normal.
However what we have here is not a C file without coverpoints, but a compilation unit without coverpoints. That is unusual and somewhat unexpected. Again: it may not be an error (e.g., you may be doing some ld -r magic) - but most users will not be doing such things - so this case does deserve a message (...which you can then ignore or not). The question then becomes what mnemonic to use or reuse. In this case: all I had done was to convert a bunch of the die calls in the original implementation to ERROR_GCOV - which may have been too granular.

A workaround that you could use in the meantime is to break your capture into multiple calls such that the GCDA files that you expect to be empty are in a different group - such that you can ignore the messages for that group but not others. (Yeah - a bit painful, probably hard to maintain, and not something I would recommend.)

Henry

henry2cox commented 5 months ago

Do you have a testcase which illustrates an incorrect error message - such that some compilation unit contains no coverage data and it really not an issue that needs investigation? I am not aware of any such examples for any internal projects (but it is possible that somebody hit an issue and simply worked around it/suppressed the message without reporting it).

If not: then I will prefer to close this issue as "worksforme" - or maybe "won't fix".

Thanks

Henry

henry2cox commented 4 months ago

No feedback - so I am going to go ahead and close this issue. See discussion above for reasoning.

If you believe that there is still a problem, please feel free to either reopen this issue or file a new one. Please include a detailed description of the problem, and include a testcase which illustrates problem if at all possible.

Henry