build: Add `-Wleading-whitespace=spaces` compiler flag
What changed, and why it matters
This commit adds a new compiler warning flag that alerts developers when source code lines begin with spaces instead of tabs. It is a code-style/build-hygiene change only and does not alter any runtime behavior, fix any vulnerability, or change how the library processes cryptographic data.
No security action needed. Treat as a normal build-system/style enforcement commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change appends -Wleading-whitespace=spaces (GCC 15+) to the default warning set in both CMakeLists.txt and configure.ac. The flag is added through the same try/append helpers used for other optional warnings, so it will be silently ignored on older toolchains. No source files, logic, or build configuration beyond warning flags were modified.
Changed components
CMakeLists.txtconfigure.acInspect captured patch +2 / −0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4953a4b..4ef69c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,6 +217,7 @@ else()
try_append_c_flags(-Wcast-align=strict) # GCC >= 8.0.
try_append_c_flags(-Wconditional-uninitialized) # Clang >= 3.0 only.
try_append_c_flags(-Wextra) # GCC >= 3.4, this is the newer name of -W, which we don't use because older GCCs will warn about unused functions.
+ try_append_c_flags(-Wleading-whitespace=spaces) # GCC >= 15.0
try_append_c_flags(-Wnested-externs)
try_append_c_flags(-Wno-long-long) # GCC >= 3.0, -Wlong-long is implied by -pedantic.
try_append_c_flags(-Wno-overlength-strings) # GCC >= 4.2, -Woverlength-strings is implied by -pedantic.
diff --git a/configure.ac b/configure.ac
index e68af3c..a21447c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,6 +112,7 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
SECP_TRY_APPEND_CFLAGS([-Wconditional-uninitialized], $1) # Clang >= 3.0 only
SECP_TRY_APPEND_CFLAGS([-Wreserved-identifier], $1) # Clang >= 13.0 only
SECP_TRY_APPEND_CFLAGS([-Wtrailing-whitespace=any], $1) # GCC >= 15.0
+ SECP_TRY_APPEND_CFLAGS([-Wleading-whitespace=spaces], $1) # GCC >= 15.0
CFLAGS="$SECP_TRY_APPEND_DEFAULT_CFLAGS_saved_CFLAGS"
fi
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.