Comments (6)
Yes - this looks a bit strange/not consistent. One would expect to see the function definition line also hit, an either line 65 or 69, if we got to line 61.
It is possible that this is an lcov bug - but it is far more likely to be inconsistency in the data generated by gcc/gcov.
(That is: a gcc instrumentation bug, or a gcov translation bug.)
If possible, try a newer GCC or LLVM and see if the issue disappears.
(Note that - once you have that newer result, you can ask genhtml to generate a differential coverage report to compare the two - and see what is different.)
You can also try a newer lcov (say, by cloning the TOT or possibly downloading the 2.1-beta release version available above.)
I suspect that that won't produce a different result, though.
If you have a testcase which exhibits the issue: please attach.
Thanks
Henry
from lcov.
could the function have gotten inlined at compile time by any chance? Hence why it's internals got hit and not the function definition itself? Could you provide what your compiler flags are especially the optimization flag used?
from lcov.
@yangsee0 try removing the O2 flag and see if that helps after a recompile and run. I don't know if the inlining of functions has been overlooked or not when accounting for function coverage in gcov but it's worth a shot to try and see. Or you could use the gcc attribute noinline
which will force the function not to be inlined by the compiler. follow this link for more
from lcov.
could the function have gotten inlined at compile time by any chance? Hence why it's internals got hit and not the function definition itself? Could you provide what your compiler flags are especially the optimization flag used?
Hello. It is performed with the options below.
-- C Flags : -Wbad-function-cast -Wincompatible-pointer-types-discards-qualifiers -Wenum-enum-conversion -Wimplicit-float-conversion -Wimplicit-int-float-conversion -Wimplicit-int-conversion -Wshorten-64-to-32 -O2 -D'FILE_NAME="$(subst .o,,$(@f))"' -march=cascadelake -Walloca -Wshift-overflow -Wstack-protector -Wformat -Wshadow -Wswitch-default -Wnull-dereference -Wredundant-decls -Wmissing-include-dirs -Wfloat-conversion -Wconversion -Wsign-conversion -Wall -Wextra
-- CXX Flags : -Wincompatible-pointer-types-discards-qualifiers -Wenum-enum-conversion -Wimplicit-float-conversion -Wimplicit-int-float-conversion -Wimplicit-int-conversion -Wshorten-64-to-32 -O2 -D'FILE_NAME="$(subst .o,,$(@f))"' -march=cascadelake -Walloca -Wshift-overflow -Wstack-protector -Wformat -Wshadow -Wswitch-default -Wnull-dereference -Wredundant-decls -Wmissing-include-dirs -Wfloat-conversion -Wconversion -Wsign-conversion -Wall -Wextra
from lcov.
Thank you for your advice.
The optimization option has been blocked and resolved.
We also confirmed that there is no problem with gcc 9.4.0.
from lcov.
Thank you for your advice. The optimization option has been blocked and resolved. We also confirmed that there is no problem with gcc 9.4.0.
happy to help!
from lcov.
Related Issues (20)
- genhtml: --keep-going doesn't work for ERROR: <file> is not readable or doesn't exist. HOT 8
- how to see the verbose error msg? HOT 11
- LCOV 2.1 not compatible with Codecov HOT 9
- LCOV coverage.dat file has "DA:0:0" HOT 3
- lcov on x86 HOT 9
- genhtml: ERROR: Can't call method "branchElem" on an undefined value HOT 2
- Duplicate folder structure (--prefix does not help) HOT 2
- gcov error:std::bad_alloc HOT 8
- lcov fails with gcc 14 HOT 1
- perl2lcov: unexpected data type 'time' HOT 6
- genhtml package removed from PyPI HOT 1
- RPM 2.1-1 does not install on Rocky Linux 8 or Centos7 HOT 1
- Unable to generate gcda file for cc_library_shared module HOT 4
- inconsistent branch coverage summary HOT 1
- Build of example fails on Ubuntu 22.04.4 LTS due to Makefile using SHELL of /bin/sh (softlink to /bin/dash) HOT 1
- Build of examples fails if part of path is a softlink HOT 4
- Option geninfo_external from a user-provided lcovrc file gets ignored HOT 4
- Incorrect #line directives cause Perl warnings HOT 1
- lcov fails with "(inconsistent) mismatched end line" for googletest code HOT 1
- lcov --no-external behaves incorrectly with 2 or more -d
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lcov.