[clazy] [Bug 411440] New: Invalid/truncated values in YAML file generated by -export-fixes= with clang diagnostics

Nikolai Kosjar bugzilla_noreply at kde.org
Fri Aug 30 11:44:33 BST 2019


https://bugs.kde.org/show_bug.cgi?id=411440

            Bug ID: 411440
           Summary: Invalid/truncated values in YAML file generated by
                    -export-fixes= with clang diagnostics
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: nikolai.kosjar at qt.io
                CC: smartins at kde.org
  Target Milestone: ---

I'm on current clazy master, commit 7a3d9cc18d96d22f8f3613396fc21a03f7f023d4

-export-fixes in combination with e.g. -Weverything seems to produce wrong yaml
files:


/tmp/test % cat clazy.clang-diagnostic.cpp 
void g()
{
    int *i;
    ++i;
}

/tmp/test % /d2/clazy/trunk/installs/Release/bin/clazy-standalone
-export-fixes=/tmp/yaml.txt clazy.clang-diagnostic.cpp -- -Weverything
/tmp/test/clazy.clang-diagnostic.cpp:1:6: warning: no previous prototype for
function 'g' [-Wmissing-prototypes]
void g()
     ^
/tmp/test/clazy.clang-diagnostic.cpp:4:7: warning: variable 'i' is
uninitialized when used here [-Wuninitialized]
    ++i;
      ^
/tmp/test/clazy.clang-diagnostic.cpp:3:11: note: initialize the variable 'i' to
silence this warning
    int *i;
          ^
           = nullptr
2 warnings generated.

==> OK, output here looks fine



/tmp/test % cat /tmp/yaml.txt 
---
MainSourceFile:  '/tmp/test/clazy.clang-diagnostic.cpp'
Diagnostics:     
  - DiagnosticName:  ' previous prototype for function ''g'''
    Message:         'no previous prototype for function ''g'''
    FileOffset:      5
    FilePath:        '/tmp/test/clazy.clang-diagnostic.cpp'
    Replacements:    []
  - DiagnosticName:  'riable ''i'' is uninitialized when used here'
    Message:         'variable ''i'' is uninitialized when used here'
    FileOffset:      29
    FilePath:        '/tmp/test/clazy.clang-diagnostic.cpp'
    Replacements:    []
...

==> Ops, DiagnosticName should be a name, but it's a truncated version of the
diagnostic message.
==> Ops, Message is also truncated.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list