Menu

False positive: selfInitialization

Vit Kucera
2025-10-21
2025-10-21
  • Vit Kucera

    Vit Kucera - 2025-10-21
    struct SomeStruct {
      SomeStruct(int a, int b) : a(a), b(b) {}
      int a, c[2]{0, 0}, b;
    };
    

    [test.cpp:2]: (error) Member variable 'b' is initialized by itself.
    Tested with cppcheck-2.18.0

     

    Last edit: Vit Kucera 2025-10-21
  • CHR

    CHR - 2025-10-21

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14218

     
    👍
    1

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.