HomeFreeBSD

MFC r365493-r365494, r365600, r365602, r365637: various WARNS fixes

Description

MFC r365493-r365494, r365600, r365602, r365637: various WARNS fixes

r365493:
libc/resolv: attempt to fix the test under WARNS=6

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()
  • 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.

For the signed/unsigned comparison, there's no compelling reason to not just
switch i/nthreads/nhosts to size_t.

The review also included a change to the load() function that was better
addressed by jhb in r365302.

r365494:
libc tests: dynthr_mod: fix some WARNS issues

This is being addressed as part of a side-patch I'm working on that builds
all the things with WARNS=6, instead of relying on it being supplied in just
shallow parts of the build with higher-level Makefile.inc.

Provide a prototype for mod_main and annotate the thread function argument
as unused.

r365600:
MFV r365599: import fix for a libexecinfo warning at higher WARNS

v1.17 of this file included a fix that I just submitted upstream to fix a
warning about prevent_inline with external linkage not having been
previously declared.

r365602:
librt: tests: fix minor issues with higher WARNS

got_sigalrm is a global with external linkage and must therefore have a
previous extern declaration. There's no reason to maintain the status quo
there, so just make it static.

The result var is unused.

This part of the test has not been upstreamed, presumably because it exists
solely for sem_clockwait_np. We should perhaps consider moving it into its
own test file outside of ^/contrib/netbsd-tests, but this can happen later.

r365637:
MFV r365636: libarchive: import fix for WARNS=6 builds in testing bits

Two more cases of explicitly marking globals for internal linkage where they
need not be shared. Committed upstream as of a38e62314a1f.

Details

Provenance
kevansAuthored on
Parents
rS365819: MFC 365276: Compute the correct size of the string to move forward.
Branches
Unknown
Tags
Unknown