<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Line endings issue with clang"
   href="https://bugs.llvm.org/show_bug.cgi?id=50300">50300</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Line endings issue with clang
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ds.akilesh@in.bosch.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi Team,

We generate the xml report for our project using gcovr( version 4.2) and clang
(version 11.0)

We are facing the line endings issue. The xml file generated as part of the
gcov and clang commands seems to contains more data than actual lines in the
file. Sonarqube-scanner is not able to find the lines mentioned in the xml and
hence fails the build.


We tried to fix the line endings issue by:

# .gitattributes approach to fix the line endings but no luck
# checked if it contains multiple files with same name and the answer is No
# there are no old gcno/gcna files available in the workspace


After addition of warnings in the gcovr, we get the below output/warnings:

WARNING: File src/src/ButtonManager/HardwareButtonHandler.cpp has 73 line(s)
but coverage data has 74 line(s).
WARNING: File src/src/ConfigurationInstaller/ConfigurationInstaller.cpp has 145
line(s) but coverage data has 155 line(s).
WARNING: File src/src/Filesystem/Filesystem.cpp has 258 line(s) but coverage
data has 549 line(s).
WARNING: File src/src/Lbtp/Client.cpp has 224 line(s) but coverage data has 404
line(s).
WARNING: File src/src/Led/Patterns/AssistanceModePattern.cpp has 46 line(s) but
coverage data has 82 line(s).
WARNING: File src/src/SystemUpdater/AllComponents.cpp has 44 line(s) but
coverage data has 177 line(s).
WARNING: File src/src/SystemUpdater/ComponentBase.cpp has 221 line(s) but
coverage data has 417 line(s).
WARNING: File src/src/Ui/Data/BatteryPackData.cpp has 53 line(s) but coverage
data has 85 line(s).
WARNING: File src/src/Ui/Views/BackgroundView.cpp has 69 line(s) but coverage
data has 76 line(s).
WARNING: File src/src/Ui/Views/BlePairingModeView.cpp has 128 line(s) but
coverage data has 194 line(s).
WARNING: File src/src/Ui/Views/CriticalErrorView.cpp has 56 line(s) but
coverage data has 78 line(s).
WARNING: File src/src/Ui/Views/DiagnosisProgramView.cpp has 35 line(s) but
coverage data has 69 line(s).
WARNING: File src/src/Ui/Views/GoodByeView.cpp has 60 line(s) but coverage data
has 79 line(s).
WARNING: File src/src/Ui/Views/NonCriticalErrorView.cpp has 83 line(s) but
coverage data has 97 line(s).
WARNING: File src/src/Ui/Views/SoftwareUpdateView.cpp has 80 line(s) but
coverage data has 88 line(s).
WARNING: File src/src/Ui/Views/StateOfChargeView.cpp has 60 line(s) but
coverage data has 92 line(s).
WARNING: File src/src/Ui/Views/WalkAssistActiveStateView.cpp has 62 line(s) but
coverage data has 69 line(s).
WARNING: File src/src/Ui/Views/WelcomeView.cpp has 52 line(s) but coverage data
has 76 line(s).

Command use for xml generation:

python -m gcovr --gcov-executable="llvm-cov gcov" -v --root
/var/jenkins/0/workspace/_feature_align-coverage-metrics2 --branches -f
'/var/jenkins/0/workspace/_feature_align-coverage-metrics2/build/unittest-clang/BRC36xx-5/Debug/(src|include)/'
-f
'/var/jenkins/0/workspace/_feature_align-coverage-metrics2/src/(src|include)/'
--object-dir=. --exclude-directories
'/var/jenkins/0/workspace/_feature_align-coverage-metrics2/build/unittest-gcc/'
--html-details=gcovreport/index.html --sonarqube=gcovreport/sonarqube.xml

For more details refer to the github issue:
<a href="https://github.com/gcovr/gcovr/issues/345">https://github.com/gcovr/gcovr/issues/345</a>

Regards,
Akilesh D S</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>