]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove more warnings from tests
authorMark Wielaard <mark@klomp.org>
Sun, 10 Oct 2021 15:13:43 +0000 (17:13 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 10 Oct 2021 15:19:34 +0000 (17:19 +0200)
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.

dhat/tests/Makefile.am
massif/tests/Makefile.am
memcheck/tests/Makefile.am
memcheck/tests/unit_oset.c
memcheck/tests/x86-linux/Makefile.am
memcheck/tests/x86/Makefile.am

index 3b0cd3e62afd5b722bf1a298bd76c5e7ca95f585..86a9b6d647cb4c5f9882274dbdb9ec3e28b17a4c 100644 (file)
@@ -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
index 0ecf09676a0e40aff67d43accd601d1f6ee6eed6..54814fb6bf9cc59959eb19d29a53f492b4924966 100644 (file)
@@ -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
index d7759296fc5217a933394453ca3aa64e14b32026..f6b97f53d33ac09dc3ae071bb6630424f4da4960 100644 (file)
@@ -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
index 1d2d2556108b5260898c953a521d698d682b7ad4..db9aab6a8b83853d6636e42254921bb7139c3806 100644 (file)
@@ -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) );
index e9fdbac5b3b5326a4876776feb6b5bd7626ee2ba..04c18442efb3825356de9f17558e2db2f128ccf4 100644 (file)
@@ -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
index 557de6b11a62142e9fffd79805d8620f1495b978..c8a0cb02fbe69572600f2ab50b1c98d509b7ee4a 100644 (file)
@@ -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