amacro.c:129: bad size in memset ?
Brought to you by:
spetm,
thepurlieu
amacro.c:129:5: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
Source code is
memset(math_op, GERBV_OPCODE_NOP, MATH_OP_STACK_SIZE);
but
gerbv_opcodes_t math_op[MATH_OP_STACK_SIZE];
Suggest new code
memset(math_op, GERBV_OPCODE_NOP, MATH_OP_STACK_SIZE * sizeof gerbv_opcodes_t);
How about:
- memset(math_op, GERBV_OPCODE_NOP, MATH_OP_STACK_SIZE);
+ memset(math_op, GERBV_OPCODE_NOP, sizeof(math_op));
Please, replace "From:" field in attached patch.
Fixed in git commit 4b332c7d1fc3181700fa1222f8cd75f8d42b6f47