Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-4753

gcc warnings not parsed correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • warnings-plugin
    • None
    • Platform: All, OS: All

    Description

      We're seeing frequent reports from the warnings plugin about "gcc error" which
      are definitely not errors, but rather warnings that originate from use of
      templates ands cause many lines of output.
      Here's one example of such warning(s):

      warnings.cc: In function 'void print(T) [with T = Test]':
      warnings.cc:9: instantiated from 'void out(T) [with T = Test]'
      warnings.cc:14: instantiated from here
      warnings.cc:6: warning: passing 'Test' chooses 'int' over 'long unsigned int'
      warnings.cc:6: warning: in call to 'std::basic_ostream<_CharT, _Traits>&
      std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char,
      _Traits = std::char_traits<char>]'
      warnings.cc:6: warning: passing 'Test' chooses 'int' over 'long int'
      warnings.cc:6: warning: in call to 'std::basic_ostream<_CharT, _Traits>&
      std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char,
      _Traits = std::char_traits<char>]'
      warnings.cc:6: warning: passing 'Test' chooses 'int' over 'unsigned int'
      warnings.cc:6: warning: in call to 'std::basic_ostream<_CharT, _Traits>&
      std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char,
      _Traits = std::char_traits<char>]'

      From this I'm told there is 1 gcc error (in line 9) and 4 warnings in line 6 (3x
      "Passing 'Test'" and 1 "in call to").
      Theoretically, it might be just one warning, but 3 warnings would be ok - the 3
      "passing 'Test'" warnings, preferably annotated/joined with the other lines to
      make things clearer. And the error is not an error, it's just information.
      It's loosely related to issue 4260 (which seems to eat the "instantiated from
      here" message) and issue 4712 (about "note:" in output).

      To reproduce: I'll attach warnings.cc. Compile with "g++ -Wsign-promo".

      Attachments

        Issue Links

          Activity

            drulli Ulli Hafner added a comment -

            Did you made some progress on that issue? Do you need some help?

            drulli Ulli Hafner added a comment - Did you made some progress on that issue? Do you need some help?
            fchateau fchateau added a comment - - edited

            Yes, I made some progress. I have something that works, and I've been testing it for a few weeks on my project and it seems satisfying. I just need to merge my modifications with the head revision and if it's fine I can commit (The admin granted me commit permission). I can send you a patch if you want to review my changes before. In fact, I was waiting for JENKINS-5671 resolution to commit, because otherwise my commit would have broken the tests and the way I solved this problem on my working copy was just dirty.

            fchateau fchateau added a comment - - edited Yes, I made some progress. I have something that works, and I've been testing it for a few weeks on my project and it seems satisfying. I just need to merge my modifications with the head revision and if it's fine I can commit (The admin granted me commit permission). I can send you a patch if you want to review my changes before. In fact, I was waiting for JENKINS-5671 resolution to commit, because otherwise my commit would have broken the tests and the way I solved this problem on my working copy was just dirty.
            drulli Ulli Hafner added a comment -

            Please go ahead and commit your changes directly. Thanks for improving the parser!

            drulli Ulli Hafner added a comment - Please go ahead and commit your changes directly. Thanks for improving the parser!

            Code changed in hudson
            User: : fchateau
            Path:
            trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/Gcc4CompilerParser.java
            trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/Gcc4LinkerParser.java
            trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
            trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/Gcc4CompilerParserTest.java
            trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/Gcc4LinkerParserTest.java
            trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java
            trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/gcc4.txt
            trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/gcc4ld.txt
            http://jenkins-ci.org/commit/29187
            Log:
            JENKINS-4753 NEW: added 2 new parsers: one for gcc 4.x compiler messages, and one for gcc 4.x linker messages. Added unit tests for these new parsers, and updated the tests of the parser registry.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : fchateau Path: trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/Gcc4CompilerParser.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/Gcc4LinkerParser.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/Gcc4CompilerParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/Gcc4LinkerParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/gcc4.txt trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/gcc4ld.txt http://jenkins-ci.org/commit/29187 Log: JENKINS-4753 NEW: added 2 new parsers: one for gcc 4.x compiler messages, and one for gcc 4.x linker messages. Added unit tests for these new parsers, and updated the tests of the parser registry.
            torbent torbent added a comment -

            I checked this issue again today, and it does appear to be better now, but still a bit confusing.
            To fchateau, who asked about compiler version:
            I am running with g++ 4.4.1 and get the same output still as I did when I submitted this issue. Did you perhaps forget the "-Wsign-promo" option?

            The current result of warning parsing (if I remember to only enable the gcc4 parser) is reported to be 4 warnings.
            The summary says:

            • Total: 4
            • High Proiority: 0
            • Normal Priority: 6
            • Low Priority: 0
              If "Total" was meant to be the sum of the others, then something is wrong

            Under "Details" in the "Warnings" tab, only one warning is listed:

            warnings.cc 6 Normal gcc4 GCC4 Error

            with the mouseover text "passing 'Test' chooses 'int' over 'long unsigned int'"
            That's quite fine, I think, except for the "GCC4 Error" part. It's only a warning.

            In the "Details" tab, 4 warnings are listed, all in line 6. Their texts are:

            passing 'Test' chooses 'int' over 'long unsigned int'
            passing 'Test' chooses 'int' over 'long int'
            in call to 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits]'
            passing 'Test' chooses 'int' over 'unsigned int'

            The "Normal" tab has the same contents as "Warnings", formatted differently.

            The counts are confusing me a bit. Is this 1 or 4 warnings?
            All in all, it's an improvement, but I'm not fully ready to close this issue yet.

            torbent torbent added a comment - I checked this issue again today, and it does appear to be better now, but still a bit confusing. To fchateau, who asked about compiler version: I am running with g++ 4.4.1 and get the same output still as I did when I submitted this issue. Did you perhaps forget the "-Wsign-promo" option? The current result of warning parsing (if I remember to only enable the gcc4 parser) is reported to be 4 warnings. The summary says: Total: 4 High Proiority: 0 Normal Priority: 6 Low Priority: 0 If "Total" was meant to be the sum of the others, then something is wrong Under "Details" in the "Warnings" tab, only one warning is listed: warnings.cc 6 Normal gcc4 GCC4 Error with the mouseover text "passing 'Test' chooses 'int' over 'long unsigned int'" That's quite fine, I think, except for the "GCC4 Error" part. It's only a warning. In the "Details" tab, 4 warnings are listed, all in line 6. Their texts are: passing 'Test' chooses 'int' over 'long unsigned int' passing 'Test' chooses 'int' over 'long int' in call to 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits] ' passing 'Test' chooses 'int' over 'unsigned int' The "Normal" tab has the same contents as "Warnings", formatted differently. The counts are confusing me a bit. Is this 1 or 4 warnings? All in all, it's an improvement, but I'm not fully ready to close this issue yet.

            People

              fchateau fchateau
              torbent torbent
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: