Menu

cppcheck "syntax error" is hard to debug

2024-05-22
2024-05-23
  • Peter Schops

    Peter Schops - 2024-05-22

    I did some time debugging some "syntax error" that SCA was throwing. The annoying thing is that cppcheck stops analysis of the file where it found the syntax error in, and it almost gives no clue where in cppcheck the syntax error was flagged for what reason.

    In my case the issue was caused by a macro not being defined. And it would have helped me if the error message would not have been so vague.

    Looking at cppcheck at all the places that can throw a syntax error, I found that Tokeninze.cpp has a lot of places where it can throw a syntax error. So I was thinking it would be nice to at least pass the function-name that throws the error, or even better add some clue what check it being performed. To make it easier for users to fix the problems.
    But I also don't want to spend time updating the file, and then in the end it never being merged.

     
  • CHR

    CHR - 2024-05-23

    We usually try to indicate the suspected macro name if possible. Improvements in this area are always welcome.
    It might also help to enable missingInclude warnings.

     

    Last edit: CHR 2024-05-23

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.