Apply the industry standard solution, as clang with
-fsanitize=address apparently enables _FORTIFY_SOURCE, leading
to a redefinition.
OLD_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-Wall -W -Werror $CXXFLAGS"
gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=2], [
- CFLAGS="-D_FORTIFY_SOURCE=2 $CFLAGS"
- CXXFLAGS="-D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS"
+ CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+ CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS"
], [CXXFLAGS="$OLD_CXXFLAGS"], [AC_LANG_PROGRAM([[#include <stdio.h>]],[])])
])