Menu

#warning makes cppcheck not show any errors, warnings or informations

2016-08-10
2016-08-11
  • Andreia Abreu

    Andreia Abreu - 2016-08-10

    I have a project where there is a #warning "something must be done" in a .h file and CPPcheck does not show any errors or warnings or messages for that project. However, if I comment-out the #warning, everything starts showing again. What is wrong?

     
  • Daniel Marjamäki

    this is a serious regression in latest 1.75. We rewrote the preprocessor and now get this behaviour. It is not by intention of course.

    Weird that we didn't see this. We tested Cppcheck on 1000's of projects before the release.

    Here is a code example that reproduce the problem:

    #warning ababa
    int x = 5/0;  // <- should say error: division by zero
    

    Could you write a ticket in our issue tracker?
    http://trac.cppcheck.net

     

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.