GCC warnings for the hmdel macro
Yu2erer opened this issue · comments
Yushan Lin commented
When using "hmdel" to delete a key from a hash table, I encountered a warning with GCC version 9.4.0: "warning: right-hand operand of comma expression has no effect [-Wunused-value]."
This is my code.
hmdel(ctx->hash_map, key);
Could you please let me know if I have used the code incorrectly?
Sean Barrett commented
Because hmdel is a macro that returns a success value, it's roughly the macro equivalent to a "function return value is ignored" warning. trying casting to (void)
, though I dunno if that will actually fix it.
Or just disable the warning.