← Back to context

Comment by kazinator

18 hours ago

It would not have averted the bug. The bug is that out is the value "*" even when setting is also "*".

It would have averted the bug in a program which checks the int return value for error.

But we had that already: the null value, different from any valid string. That had to be done away with because programmers couldn't be relied upon to check for it.

Those same programmers are not going to check an integer value which doesn't even threaten them with a segfault.

(However, there is a GCC attribute that can be given to functions such that a diagnostic is produced if their value is not used: that could be profitably used with the above API.)