Well I hope this makes it to the code in the future. I just wanted to report it. Thanks!
the problem is mostly for cppcheck to determine "required size". for msgqtl it's hard because it magically depends on what integer value parameter #2 has. I would say that this is not the case here, namely we just care about the structure parameters passed as pointers (assuming we want to store or read values, as I don't see other purpose). That being said if we don't pass NULL (case in which we don't care as it will either crash, or work properly based on the function parameters) we need to make...
I don't know the exact capabilities of cppcheck related to determining structure sizes defined but as long as we do the following: check the function prototype see the size of each parameter passed as pointer compare size of parameter to the required size issue an error in case the size of the varable is less than required a warning in case the variable is more than required (possibly uninitialized data because of incomplete writing) This issue was very hard to discover because it was writing to...
I had the following in some legacy code and neither cppcheck or coverity found this issue. #include <sys/msg.h> int main() { int msqid = 2; struct msqid_ds *buf; msgctl(msqid, IPC_STAT, (struct msqid_ds*)&buf); return 0; } The problem is the fact that it tries to write an entire structure (tens of bytes) in the space held by a pointer (8 bytes on 64 bit linux). Is this feasable to be implemented in cppcheck?
New event handling + showed the dialog
New dialog + better names for variables
summer school helper exercises
Added other useful code snippets