Menu

false syntax error: warning G3F4AE7A4: syntax error [syntaxError]

2025-01-09
2025-01-09
  • Emiel Estiévenart

    I recently updated to Cppcheck 2.16 and added the exhaustive flag to my run.
    Since then I get a few syntax errors.

    _bam_data.init_data.nof_packets = details.data_size / 7;

    details is just a struct and data_size is a uint16_t. This error wasn't here before upgrading.
    Even when I rework this to something like this:
    auto var = 10u / 7u;

    the issue remains.

    After uninstalling and trying out 2.15 the issue remains.
    Exhaustive or not doesn't seem to resolve the issue.

     
  • CHR

    CHR - 2025-01-09

    Looking at the preprocessed output (pass -E option) might give a clue what's going on.

     
  • Emiel Estiévenart

    1>_bam_data . init_data . nof_packets = details . data_size FR 1 7 ;

    Does this help?

     
    • CHR

      CHR - 2025-01-09

      Certainly doesn't look like valid code. How does / become FR 1?

       
  • Emiel Estiévenart

    A preprocessor definition got into the code. There was a CMake compile definition for /FR.
    I removed it. Now the error is gone.
    Thank you for the support!

     

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.