If I comment out either g or h, the error disappears. It seems like cppcheck takes the size of the array "a" from h (where it is 4 bytes) and then uses it while analyzing g (where it should be 6 bytes instead).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I analyzed the following file.
cppcheck 2.8 and also the current tip of the main branch give the following false error:
If I comment out either g or h, the error disappears. It seems like cppcheck takes the size of the array "a" from h (where it is 4 bytes) and then uses it while analyzing g (where it should be 6 bytes instead).
Thanks! I have created https://trac.cppcheck.net/ticket/11140