Menu

syntaxError

2019-02-05
2019-02-07
  • Björn Möller

    Björn Möller - 2019-02-05

    Hi,
    The code snipet below is not accepted by cppcheck. The problem is that it's not possible to supress neither inline nor in my supression-file.
    I'm using v1.83.
    A bug?

    template <Device D>
    const char* deviceFile;
    
    template <>                  <=error: syntax error [syntaxError]
    const char* deviceFile<Device::I2C0> = "/tmp/i2c-0";
    
     

    Last edit: Björn Möller 2019-02-06
  • Daniel Marjamäki

    A bug?

    Maybe.

    Was this by intention </device>? I can reproduce the syntax error with that but it does not seem to be valid C++ syntax.

     
  • Björn Möller

    Björn Möller - 2019-02-06

    The code wasn't saved correctly without marking it as code.

     
  • Daniel Marjamäki

    thanks. I can reproduce. It is a bug. I created this ticket: https://trac.cppcheck.net/ticket/8967

     
  • Daniel Marjamäki

    This bug is already fixed.
    https://github.com/danmar/cppcheck/pull/1647

    We will release a new cppcheck version with this bug fix soon. Probably this weekend.

     

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.