Menu

syntaxError - cppcheck 2.12.1

2023-10-18
2023-11-01
  • Toni Neubert

    Toni Neubert - 2023-10-18

    When using the following library/code: https://godbolt.org/z/8s33YjbWe

    cppchecks stops with a "syntaxError" without deeper explanation:

    <error id="syntaxError" severity="error" msg="syntax error" verbose="syntax error" file0="/builds/....cpp">
    

    Since the code works well with clang-16, I tried to use cppcheck with the: --clang=clang-16
    But than I get (for every file, unrelated tho the code):

    <error id="internalError" severity="error" msg="Bailing out from analysis: Processing Clang AST dump failed: converting &apos;&apos; to integer failed - not an integer" verbose="Bailing out from analysis: Processing Clang AST dump failed: converting &apos;&apos; to integer failed - not an integer">
    
     
  • CHR

    CHR - 2023-10-18

    Thanks for reporting, see https://trac.cppcheck.net/ticket/11275

     
    👍
    1
  • Toni Neubert

    Toni Neubert - 2023-10-20

    Thank you for the fast response.

    cppcheck fails on one other parts too:
    - https://github.com/Viatorus/emio/blob/main/include/emio/detail/format/formatter.hpp#L793
    <error id="internalAstError" severity="error" msg="Syntax Error: AST broken, binary operator '||' doesn't have two operands." verbose="Syntax Error: AST broken, binary operator '||' doesn't have two operands." file0="..."></error>

    What I also found out is, that cppcheck does not support __VA_OPT__.

    #define FOO(x, ...) call(x __VA_OPT__(, ) __VA_ARGS__)
    
    void call(int i, int j) {}
    
    int main() {
      FOO(1, 2);
    }
    
     
  • Toni Neubert

    Toni Neubert - 2023-11-01

    Thank you for fixing this.

    Any updates here for the other two issues?

     
  • Toni Neubert

    Toni Neubert - 2023-11-01

    Thank you for fixing this.

    Any updates here for the other two issues?

     
  • CHR

    CHR - 2023-11-01

    C++20 issues are collected here: https://trac.cppcheck.net/ticket/10251

     

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.