Jim Klimov <[email protected]> writes: > The problem is, as far as NUT code is concerned, we are using tolower(), > isalpha() etc. which may well be real functions in some libraries and > macros with bit-shift magic or arrays on others... > This is hard to catch without actually running builds on dozens of > platforms :)
Yes, but the spec for them says that they take an int, and may only be called with values that fit in unsigned char or EOF. So there's code review, and there's test test builds. NetBSD makes a point of throwing warnings; I suspect but am not sure that if a NetBSD build is warning free that ctype(3) usage is legit. In NetBSD current I think we are getting check/assert for being out of range. We'll see how that goes. An attempt to assert on invalid pthread usage earlier did show that many many programs do wrong things (re-initializing an initialized mutex, using one not initialized, unlocking an unlocked mutex, etc.). But this was not that useful in the end as upstreams did not care and their programs did not run. I think now it can be optionally turned on to debug pthread usage. _______________________________________________ Nut-upsdev mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev
