Skip to content

Commit d704af6

Browse files
author
Marc Stern
committed
Define _FORTIFY_SOURCE=3 & _GLIBCXX_ASSERTIONS that add glibc/libstdc++ assertions.
See https://www.gnu.org/software/libc/manual/html_node/Source-Fortification.html & https://gcc.gnu.org/wiki/LibstdcxxDebugMode _GLIBCXX_ASSERTIONS is probably useless as we have pure C here, but let's define it in case some checks are included (or will be in a future version). As we handle some requests here, that may help to trap a problem.
1 parent 7126574 commit d704af6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ fi
309309

310310
AC_ARG_ENABLE(assertions,
311311
AS_HELP_STRING([--enable-assertions],
312-
[Turn on assertions checks (undefine NDEBUG)]),
312+
[Turn on assertions checks (undefine NDEBUG, define _GLIBCXX_ASSERTIONS & _FORTIFY_SOURCE)]),
313313
[
314314
if test "${enableval}" = "yes"; then
315-
assertions='-UNDEBUG'
315+
assertions='-UNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS'
316316
else
317317
assertions='-DNDEBUG'
318318
fi

0 commit comments

Comments
 (0)