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

gcc warnings not parsed correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-plugin
    • None
    • Platform: All, OS: All

      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".

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

              Created:
              Updated:
              Resolved: