]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r365493-r365494, r365600, r365602, r365637: various WARNS fixes
authorKyle Evans <kevans@FreeBSD.org>
Wed, 16 Sep 2020 23:14:22 +0000 (23:14 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 16 Sep 2020 23:14:22 +0000 (23:14 +0000)
commit25e38e79ad3a694a3469acdba7634bc860bde19a
tree159eef255cf8e07b9475e77a0f975c08f9ab8f4e
parent59b28017d24a48dfe852b45a1c60e7792dca2a9a
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.
contrib/libarchive/test_utils/test_main.c
contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c
contrib/netbsd-tests/lib/librt/t_sem.c
lib/libc/tests/resolv/resolv_test.c
lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c