1

gcov primarily is a code coverage tool. However, is there any way we can find LOC (excluding comments...etc) with gcov?

It must be easy for gcov to get that information, but I didn't find any documentation on that.

Also, let me know if you know any other tool which can calculate lines of code in such manner.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
ernesto
  • 1,899
  • 4
  • 26
  • 39
  • there's an option in lcov "--initial". It will generate a baseline coverage information which contains LOC and lot more. – ernesto Feb 04 '14 at 04:15

2 Answers2

1

You can also look at SLOCCount, which is available in packages on most Linux distributions.

Phil Miller
  • 36,389
  • 13
  • 67
  • 90
0

if you want to another tool for just counting line of code(LOC) then please go for cloc. For more info regarding supported os and installation go to http://cloc.sourceforge.net/.

Jayesh Bhoi
  • 24,694
  • 15
  • 58
  • 73