cppcheck seems to pick up the file path from a #line directive as is if given. On Windows, backslashes in the original file path are escaped (double backslash) in #line directives (as required by the cpp standard I believe).
Would it be possible to revert the backslash escape of those file paths in the cppcheck output (maybe for Windows only)?
Or am I missing some config here?
Many thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
cppcheck 1.90 on Windows10:
cppcheck seems to pick up the file path from a
#line
directive as is if given. On Windows, backslashes in the original file path are escaped (double backslash) in#line
directives (as required by the cpp standard I believe).Would it be possible to revert the backslash escape of those file paths in the cppcheck output (maybe for Windows only)?
Or am I missing some config here?
Many thanks.
Yes we should do that.
Could you create a ticket in the simplecpp issue tracker?
https://github.com/danmar/simplecpp/issues
If you have some time feel free to try to make a fix. Here is a test I think is related:
https://github.com/danmar/simplecpp/blob/c27e5d46dced1f8ead1f3a755ce539cdd0ee42b2/test.cpp#L1045
See also:
https://github.com/danmar/simplecpp/blob/c27e5d46dced1f8ead1f3a755ce539cdd0ee42b2/simplecpp.cpp#L500
PR submitted.
Happy to close this ticket if possible.