Menu

unusedStructMember false-postive with static const int in same structure

2021-09-14
2021-09-14
  • Steve Albright

    Steve Albright - 2021-09-14

    unusedStructMember - struct member 'DataToEncrypt::ENCRYPTED_DATA_BUF_SIZE' is never used

    It is used as a size for the unsigned char array two lines lower.

    namespace unusedStructMemberFalsePostive
    {
       struct DataToEncrypt
       {
          static const int ENCRYPTED_DATA_BUF_SIZE = 128;
    
          unsigned char EncryptedDataBuf[ENCRYPTED_DATA_BUF_SIZE];
       };
    }
    
     
  • CHR

    CHR - 2021-09-14

    Thanks for the report, ticket is here: https://trac.cppcheck.net/ticket/10485

     

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.