On Thu, 22 May 2008 18:50:19 +0200
Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
It would be regrettable to add source-level complexity and runtime cost
to detect this particular bug. I think it would be better to do this
via static source-code checking if at all possible.
Is there _any_ legitimate use of non-negative EFOO? There might be
some baroque bits of code which are using non-negative constants in a
non-buggy fashion, but I bet they could be reworked to use negative
constants.
In which case I'd have thought that a script which
a) extracts all the EFOO identifiers from include/*/errno.h and
b) greps the tree for non-negative uses of those
would have 100% coverage?
We might need to touch up some code sites to avoid triggering false
positives and make that script's life a bit easier, but that's fine.
--