nothings / stb

stb single-file public domain libraries for C/C++

Home Page:https://twitter.com/nothings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GCC warnings for the hmdel macro

Yu2erer opened this issue · comments

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?

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.