From: Mark Wielaard Date: Sun, 10 Oct 2021 15:13:43 +0000 (+0200) Subject: Remove more warnings from tests X-Git-Tag: VALGRIND_3_18_0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfd28bb9f83c34cd366ac63a72d1fc0bf2028060;p=thirdparty%2Fvalgrind.git Remove more warnings from tests GCC12 catches various issues in tests at compile time that we want to catch at runtime. Also glibc 2.34 deprecated various mallinfo related functions. Add the relevant -Wno-foobar flags to those tests. In one case, unit_oset.c, the warning was correct and the uninitialized variable was explicitly set. --- diff --git a/dhat/tests/Makefile.am b/dhat/tests/Makefile.am index 3b0cd3e62a..86a9b6d647 100644 --- a/dhat/tests/Makefile.am +++ b/dhat/tests/Makefile.am @@ -26,5 +26,6 @@ check_PROGRAMS = \ AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) -# We don't care about unused malloc results +# We don't care about uninitialized or unused malloc results +basic_CFLAGS = $(AM_CFLAGS) -Wno-uninitialized big_CFLAGS = $(AM_CFLAGS) -Wno-unused-result diff --git a/massif/tests/Makefile.am b/massif/tests/Makefile.am index 0ecf09676a..54814fb6bf 100644 --- a/massif/tests/Makefile.am +++ b/massif/tests/Makefile.am @@ -100,3 +100,4 @@ insig_CFLAGS = $(AM_CFLAGS) -Wno-unused-result long_names_CFLAGS = $(AM_CFLAGS) -Wno-unused-result one_CFLAGS = $(AM_CFLAGS) -Wno-unused-result thresholds_CFLAGS = $(AM_CFLAGS) -Wno-unused-result +realloc_CFLAGS = $(AM_CFLAGS) -Wno-free-nonheap-object diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index d7759296fc..f6b97f53d3 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -508,13 +508,17 @@ demangle_SOURCES = demangle.cpp # Suppress various gcc warnings which are correct, but for things # we are actually testing for at runtime. accounting_CFLAGS = $(AM_CFLAGS) -Wno-alloc-size-larger-than +badfree_CFLAGS = $(AM_CFLAGS) -Wno-free-nonheap-object bug155125_CFLAGS = $(AM_CFLAGS) -Wno-unused-result -Wno-alloc-size-larger-than +mallinfo_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations malloc3_CFLAGS = $(AM_CFLAGS) -Wno-alloc-size-larger-than +sbfragment_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations +strchr_CFLAGS = $(AM_CFLAGS) -Wno-uninitialized big_debuginfo_symbol_SOURCES = big_debuginfo_symbol.cpp big_debuginfo_symbol_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x -bug340392_CFLAGS = $(AM_CFLAGS) -O3 +bug340392_CFLAGS = $(AM_CFLAGS) -O3 -Wno-maybe-uninitialized dw4_CFLAGS = $(AM_CFLAGS) -gdwarf-4 -fdebug-types-section descr_belowsp_LDADD = -lpthread @@ -535,7 +539,7 @@ execve1_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@ execve2_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@ -fprw_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ +fprw_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ -Wno-free-nonheap-object inits_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ @@ -647,7 +651,7 @@ else varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \ -Wl,-soname -Wl,varinfo5so.so endif -varinforestrict_CFLAGS = $(AM_CFLAGS) -O0 -g +varinforestrict_CFLAGS = $(AM_CFLAGS) -O0 -g -Wno-maybe-uninitialized # Build shared object for wrap7 wrap7_SOURCES = wrap7.c diff --git a/memcheck/tests/unit_oset.c b/memcheck/tests/unit_oset.c index 1d2d255610..db9aab6a8b 100644 --- a/memcheck/tests/unit_oset.c +++ b/memcheck/tests/unit_oset.c @@ -92,6 +92,7 @@ void example1singleset(OSet* oset, char *descr) UWord sorted_elts[NN]; // Used to test VG_(OSetGen_ResetIterAt) // Try some operations on an empty OSet to ensure they don't screw up. + v = 0; vg_assert( ! VG_(OSetGen_Contains)(oset, &v) ); vg_assert( ! VG_(OSetGen_Lookup)(oset, &v) ); vg_assert( ! VG_(OSetGen_Remove)(oset, &v) ); diff --git a/memcheck/tests/x86-linux/Makefile.am b/memcheck/tests/x86-linux/Makefile.am index e9fdbac5b3..04c18442ef 100644 --- a/memcheck/tests/x86-linux/Makefile.am +++ b/memcheck/tests/x86-linux/Makefile.am @@ -28,3 +28,4 @@ AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE) AM_CXXFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE) AM_CCASFLAGS += @FLAG_M32@ +scalar_supp_CFLAGS = $(AM_CFLAGS) -Wno-uninitialized diff --git a/memcheck/tests/x86/Makefile.am b/memcheck/tests/x86/Makefile.am index 557de6b11a..c8a0cb02fb 100644 --- a/memcheck/tests/x86/Makefile.am +++ b/memcheck/tests/x86/Makefile.am @@ -52,6 +52,7 @@ AM_CCASFLAGS += @FLAG_M32@ # fpeflags must use these flags -- bug only occurred with them. fpeflags_CFLAGS = $(AM_CFLAGS) -march=i686 +pushfpopf_CFLAGS = $(AM_CFLAGS) -Wno-uninitialized pushfpopf_SOURCES = pushfpopf_c.c pushfpopf_s.S if VGCONF_OS_IS_DARWIN pushpopmem_CFLAGS = $(AM_CFLAGS) -mdynamic-no-pic