Menu

__has_include operator not identified?

Martin
2022-02-28
2022-06-14
  • Martin

    Martin - 2022-02-28

    Hi,

    the code

    #if __has_include(<bar/bar2/bar3.hpp>)
       foo()
    #endif
    

    leads to

    (error) failed to evaluate #if condition, division/modulo by zero
    

    for cppcheck head.

    Could you please check?

    Thanks,
    Martin

     
  • Jens Yllman

    Jens Yllman - 2022-05-09

    The thing is that cppcheck does not know that __has_include() is not a normal function. So it does not manage to identify the argument, since it it not a valid argument to a normal function.

     
  • Daniel Marjamäki

    oops it does not seem to handle <somefile.h>. there is handling of __has_include("somefile.h")

     

    Last edit: Daniel Marjamäki 2022-06-14

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.