Menu

Preprocessor ignores #error directive

vilox
2021-01-21
2021-01-23
  • vilox

    vilox - 2021-01-21

    Let check this test.c:

    #error BOOOOM
    int main(void) { return 0; }
    

    Suddenly,

    $ cppcheck --enable=all --error-exitcode=17 test.c; echo $?
    Checking test.c ...
    0

    Applies to version 2.3, current git (2020-12-28 b94a6d595), debian 10 on x64.
    I do not have a bugtracker account, so I report this here.

     
  • Daniel Marjamäki

    Thanks! We skip configurations that have #error.. I think that this will be fixed by https://trac.cppcheck.net/ticket/10132
    I agree cppcheck output is not very clear here.

     

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.