Skip to content

Commit 65f0e7f

Browse files
committed
build: Add -Wtrailing-whitespace=any compiler flag
1 parent f53946a commit 65f0e7f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ else()
224224
try_append_c_flags(-Wreserved-identifier) # Clang >= 13.0 only.
225225
try_append_c_flags(-Wshadow)
226226
try_append_c_flags(-Wstrict-prototypes)
227+
try_append_c_flags(-Wtrailing-whitespace=any) # GCC >= 15.0
227228
try_append_c_flags(-Wundef)
228229
endif()
229230

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
111111
SECP_TRY_APPEND_CFLAGS([-Wcast-align=strict], $1) # GCC >= 8.0
112112
SECP_TRY_APPEND_CFLAGS([-Wconditional-uninitialized], $1) # Clang >= 3.0 only
113113
SECP_TRY_APPEND_CFLAGS([-Wreserved-identifier], $1) # Clang >= 13.0 only
114+
SECP_TRY_APPEND_CFLAGS([-Wtrailing-whitespace=any], $1) # GCC >= 15.0
114115
115116
CFLAGS="$SECP_TRY_APPEND_DEFAULT_CFLAGS_saved_CFLAGS"
116117
fi

src/checkmem.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,15 @@
7878
# if defined(__clang__) && defined(__APPLE__)
7979
# pragma clang diagnostic push
8080
# pragma clang diagnostic ignored "-Wreserved-identifier"
81+
# elif defined(__GNUC__) && (__GNUC__ >= 15)
82+
# pragma GCC diagnostic push
83+
# pragma GCC diagnostic ignored "-Wtrailing-whitespace"
8184
# endif
8285
# include <valgrind/memcheck.h>
8386
# if defined(__clang__) && defined(__APPLE__)
8487
# pragma clang diagnostic pop
88+
# elif defined(__GNUC__) && (__GNUC__ >= 15)
89+
# pragma GCC diagnostic pop
8590
# endif
8691
# define SECP256K1_CHECKMEM_ENABLED 1
8792
# define SECP256K1_CHECKMEM_UNDEFINE(p, len) VALGRIND_MAKE_MEM_UNDEFINED((p), (len))

0 commit comments

Comments
 (0)