Menu

#105 amd.cpp:58:26: warning: 'memset' call operates on objects of type 'struct Instrument' while the size is based on a different type 'struct Instrument *' [-Wsizeof-pointer-memaccess]

open
nobody
None
5
2014-03-27
2014-03-27
dcb
No

Source code is

memset(inst, 0, sizeof(inst));

Maybe better code might be

memset(inst, 0, sizeof(*inst));

I found this bug using clang.
The bug also exists in current CVS source.

Discussion


Log in to post a comment.