Menu

CAN'T GET ONLY MEMORY LEAK ISSUES FOR CPP FILES

2016-08-18
2016-08-29
  • Abhinaav Singh

    Abhinaav Singh - 2016-08-18

    I am using cppcheck without GUI and I'm unable to fetch only Memory leak issues.

    I am using String.Format("cppcheck.exe --force -j 4 --enable=all \"{0}\" 2> \"{1}\"", sourceCodeDirectory, cppCheckOutputFile);

    What change should I make to fetch just memory leak issues. I know it falls under severity: ERROR

    What to do.

    Thanks.

     
  • Mr. X

    Mr. X - 2016-08-18

    And this issue is so urgent that you need to scream in the topic title?

    Anyway, there is no way to just output a particular message ID (and imho it does not make sense to have such an option). You can hide messages by ID by --suppress=MsgId or filter the output by some regular expressions..

     
  • Mr. X

    Mr. X - 2016-08-18

    Btw., if you use --enable=all, you enable also non-error messages. This is the opposite of what you want.

     
  • Abhinaav Singh

    Abhinaav Singh - 2016-08-19

    Sorry for the caps lock.
    I know, but I did only need just Memory leak messages for my work.
    I'm having to seggregate the error messages as there is no such thing as enable=error.
    So, I parsed the text and picked the memory leak messages.

     
  • Mr. X

    Mr. X - 2016-08-19

    I'm having to seggregate the error messages as there is no such thing as enable=error

    error is always enabled.

     
  • AnotherUser

    AnotherUser - 2016-08-29

    Abhinaav Singh : why not simply run this through a regexp filter, like in notepad++ to filter only errors with the message you want to see (eg containing the words "Memory leak").

    Looks like there is a plugin to do this:
    https://sourceforge.net/p/notepad-plus/discussion/482781/thread/5b42fcb9/

    Or, you could simply use a regexp find/replace "^(.*leak.*)" or similar to remove non-matching output messages

    Or, if you know how to use cygwin, you could just grep...

     

    Last edit: AnotherUser 2016-08-29

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.