In a side-change that I'm working on to start defaulting src builds to WARNS=6 where WARNS isn't otherwise specified, GCC6 (and clang, to a lesser extent) pointed out a number of issues with the resolv tests:
- Global method variable that gets shadowed in run_tests()
- Pointer comparison to char ('\0')
- Signed/unsigned comparison between i in run_tests() and hosts->sl_cur
The shadowed variable looks like it might actually be bogus as written, as we pass it to RUN_TESTS -> run_tests, but other parts use the global method instead. This change is mainly geared towards correcting that by removing the global and plumbing the method through from run_tests -> run into the new thread.
I assume from the context of ptr == '\0' that it was intended to check for an empty string, so it's adjusted to ptr == '\0'.
For signed/unsigned comparison, there's no compelling reason to not just switch i/nthreads/nhosts to size_t.