lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> -Wunused-value

It’s hard to imagine how this warning could be considered “low-to-negative value”.

It always means that there is some redundancy in your code, which almost always implies that you have made a mistake.

Perhaps you saved a result into a variable but later “retrieved” it for use from the wrong place (e.g. saving ‘curr_buff_limit’ but later passing ‘buff_absolute_maxlen’ to a later function)?

Perhaps you refactored your code but never quite finished the job, or changed some behaviour incorrectly?

Perhaps you have some clumsy cross-platform macro code generation mess that leaks unwanted and even potentially incorrect code into the final compile for some build targets, implying that your cross-platformness is not as well-tested as you thought?

(Unused values that aren’t needed should be removed. They are just a needless complication. Unused values that are needed represent a bug that needs fixing. Unused values that you can’t immediately explain imply #preprocesor madness you can’t excuse…)