]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix the ramaining easily fixable warnings with clang
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 10 Oct 2021 19:56:49 +0000 (21:56 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 10 Oct 2021 19:56:49 +0000 (21:56 +0200)
There's one remaining
memalign2.c:29:9: warning: unused variable 'piece' [-Wunused-variable]
because of a block of #if FreeBSD for memalign that looks unnecessary

Otherwise all that is left is a few like

warning: unknown warning option '-Wno-alloc-size-larger-than'; did you mean '-Wno-frame-larger-than='? [-Wunknown-warning-option]

because there is no standard for compiler arguments.

coregrind/m_gdbserver/valgrind-low-nanomips.c
drd/tests/tc12_rwl_trivial.stderr.exp
helgrind/tests/safe-pthread.h
helgrind/tests/safe-semaphore.h
massif/tests/Makefile.am
memcheck/tests/Makefile.am
none/tests/Makefile.am
none/tests/amd64/sbbmisc.c
none/tests/x86/sbbmisc.c

index e8ed36400b69d67071af3799b29dd267164ac613..77a4190fe0b8080cf7070c7e0bc6f889ce384ab0 100644 (file)
@@ -107,6 +107,7 @@ void set_pc (CORE_ADDR newpc)
 #define itype_rt(x) ((x >> 16) & 0x1f)
 #define rtype_funct(x) (x & 0x3f)
 
+static inline UInt getUInt(UChar * p) __attribute__((unused));
 /* Do a endian load of a 32-bit word, regardless of the
    endianness of the underlying host. */
 static inline UInt getUInt(UChar * p)
index 73163e7b23c5a7b73911d7189cd7d404e6211eb1..b2d4048ab6db3880c487943c51f367213d84c571 100644 (file)
@@ -1,7 +1,7 @@
 
 Reader-writer lock not locked by calling thread: rwlock 0x.........
    at 0x........: pthread_rwlock_unlock (drd_pthread_intercepts.c:?)
-   by 0x........: safe_pthread_rwlock_unlock (safe-pthread.h:58)
+   by 0x........: safe_pthread_rwlock_unlock (safe-pthread.h:59)
    by 0x........: main (tc12_rwl_trivial.c:29)
 rwlock 0x........ was first observed at:
    at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
index 0a2c813237c57f67c5ea92302cc4f70aaa735916..788f7b89b63627085a7500c3d1418577d1f5a1ec 100644 (file)
@@ -28,6 +28,7 @@ static void segv_handler( int signum, siginfo_t *siginfo, void *sigcontext ) {
    siglongjmp( env, EPERM );
 }
 
+static int safe_pthread_rwlock_unlock( pthread_rwlock_t *rwlock ) __attribute__((unused));
 /*
  * Wrapper for pthread_rwlock_unlock which may execute xend
  * unconditionally when used on a lock that is not locked.
index 3aa0dc4e4ceeee3d557b0660ad1408ae3e543ef0..c0e003bcbcb3a0594cd9a5f9af090ce0ca4562d0 100644 (file)
@@ -14,6 +14,7 @@ static void abrt_handler( int signum, siginfo_t *siginfo, void *sigcontext ) {
    siglongjmp( env, EINVAL );
 }
 
+static int safe_sem_post( sem_t *sem ) __attribute__((unused));
 static int safe_sem_post( sem_t *sem ) {
    struct sigaction sa;
    struct sigaction oldsa;
index 54814fb6bf9cc59959eb19d29a53f492b4924966..5b3d1938f44a738dfafe190846762d7edd2f7b84 100644 (file)
@@ -88,6 +88,10 @@ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
 # C++ tests
 new_cpp_SOURCES                = new-cpp.cpp
 overloaded_new_SOURCES = overloaded-new.cpp
+# pre C++11 compilers don't have exception specs
+# C++11 and later compilers may complain about not having
+# exception specs
+overloaded_new_CXXFLAGS        = $(AM_CXXFLAGS) -Wno-implicit-exception-spec-mismatch -Wno-missing-exception-spec
 
 # Suppress warnings for issues we are testing for
 alloc_fns_CFLAGS       = $(AM_CFLAGS) -Wno-unused-result
index f6b97f53d33ac09dc3ae071bb6630424f4da4960..4d0476e2dfc3bf2b979029d2fe819866d7e88538 100644 (file)
@@ -584,7 +584,8 @@ origin6_fp_CFLAGS   = $(AM_CFLAGS) -O
 
 # Don't allow GCC to inline memcpy() and strcpy(),
 # because then we can't intercept it
-overlap_CFLAGS         = $(AM_CFLAGS) -fno-builtin-memcpy -fno-builtin-strcpy
+overlap_CFLAGS         = $(AM_CFLAGS) -fno-builtin-memcpy -fno-builtin-strcpy \
+                         -Wno-fortify-source
 
 resvn_stack_CFLAGS      = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@
 
@@ -602,6 +603,7 @@ endif
 
 str_tester_CFLAGS      = $(AM_CFLAGS) -Wno-shadow -Wno-stringop-overflow \
                          -Wno-stringop-truncation \
+                         -Wno-fortify-source -Wno-suspicious-bzero \
                          @FLAG_W_NO_MEMSET_TRANSPOSED_ARGS@
 
 supp_CFLAGS             = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@
@@ -702,5 +704,6 @@ xml1_CFLAGS             = $(AM_CFLAGS) -D_GNU_SOURCE
 if HAVE_ALIGNED_CXX_ALLOC
 check_PROGRAMS += cxx17_aligned_new
 cxx17_aligned_new_SOURCES  = cxx17_aligned_new.cpp
-cxx17_aligned_new_CXXFLAGS = -std=c++17
+# need C++ 17, and we deliberately mismatch new and delete
+cxx17_aligned_new_CXXFLAGS = -std=c++17 -Wno-mismatched-new-delete
 endif
index 7ac07c68d57f5c01dc154de02be4cc15ea897b68..24a81b3be98383365b777197934c5ae792f395ac 100644 (file)
@@ -303,6 +303,7 @@ fdleak_creat_LDADD  = -lsocket -lnsl
 fdleak_socketpair_LDADD        = -lsocket -lnsl
 endif
 floored_LDADD          = -lm
+ifunc_CFLAGS           = $(AM_CFLAGS) -Wno-unused-function
 manythreads_LDADD      = -lpthread
 if VGCONF_OS_IS_DARWIN
  nestedfns_CFLAGS      = $(AM_CFLAGS) -fnested-functions
index f82cc6ba0972751db0b4706aba8f963884b43b01..82b5db0ce2710dcb434c4ae8c566f52ae7126839 100644 (file)
@@ -401,7 +401,7 @@ int main ( void )
    adc_ib_al();
    printf("r8 = %d %d\n", (int)out_b1, (int)out_b2);
 
-   in_w = 49999;
+   in_w = -15537;
    adc_iw_ax();
    printf("r9 = %d %d\n", (int)out_w1, (int)out_w2);
 
index f9e7f901ca075a7df9ad1e67e7accd0059fd27bf..6e3822cb380641e594bcd66a1bd87ac30faf1e22 100644 (file)
@@ -252,7 +252,7 @@ int main ( void )
    adc_ib_al();
    printf("r8 = %d %d\n", (int)out_b1, (int)out_b2);
 
-   in_w = 49999;
+   in_w = -15537;
    adc_iw_ax();
    printf("r9 = %d %d\n", (int)out_w1, (int)out_w2);