On 10/10/23 05:55, Markus Armbruster wrote:
Richard Henderson <richard.hender...@linaro.org> writes:
Do not rely on return value of 0 to indicate error,
pass along an Error pointer to be set.
Not wrong, but goes against error.h's recommendation
* - Whenever practical, also return a value that indicates success /
* failure. This can make the error checking more concise, and can
* avoid useless error object creation and destruction. Note that
* we still have many functions returning void. We recommend
* • bool-valued functions return true on success / false on failure,
* • pointer-valued functions return non-null / null pointer, and
* • integer-valued functions return non-negative / negative.
...
Returning -1 here would stick to error.h's recommendation.
The problem had been that 0 would become a valid result in the next patch.
But using -1 would work, particularly with bit 31 of the log mask as yet unused.
r~