1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-06 08:49:29 +02:00

Add -Werror -Wfatal-errors -g flags to configure --enable-test.

These flags are used for all tests but it was not possible to add them to configure before the change in 046d6643. This is especially important for adhoc tests to ensure the flags are not forgotten.

Remove the flags from test make commands where they were being applied.

There is no change for production builds.
This commit is contained in:
David Steele
2021-10-19 12:45:20 -04:00
parent 046d664337
commit 5dfdd6dd5b
4 changed files with 17 additions and 5 deletions

View File

@@ -161,6 +161,12 @@ else
# Add additional warnings
AC_SUBST(CFLAGS, "${CFLAGS} -Wwrite-strings -Wconversion -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith")
AC_SUBST(CFLAGS, "${CFLAGS} -Wvla")
# Add error on warnings and stop on first error
AC_SUBST(CFLAGS, "${CFLAGS} -Werror -Wfatal-errors")
# Add debug info
AC_SUBST(CFLAGS, "${CFLAGS} -g")
fi
# Write output

10
src/configure vendored
View File

@@ -4384,6 +4384,14 @@ fi
CFLAGS="${CFLAGS} -Wvla"
# Add error on warnings and stop on first error
CFLAGS="${CFLAGS} -Werror -Wfatal-errors"
# Add debug info
CFLAGS="${CFLAGS} -g"
fi
# Write output
@@ -5664,4 +5672,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
# Generated from src/build/configure.ac sha1 999f26c80409188dd6ae0d2e9fed7e56d765b056
# Generated from src/build/configure.ac sha1 b69b4dba61cbc695a6e947f8415d430163db8821

View File

@@ -289,7 +289,7 @@ sub run
# Generate Makefile.param
my $strMakefileParam =
"CFLAGS =" .
" \\\n\t-Werror -Wfatal-errors -g" .
" \\\n\t-DERROR_MESSAGE_BUFFER_SIZE=131072" .
($self->{bProfile} ? " \\\n\t-pg" : '') .
(vmArchBits($self->{oTest}->{&TEST_VM}) == 32 ? " \\\n\t-D_FILE_OFFSET_BITS=64" : '') .
($self->{bDebug} ? '' : " \\\n\t-DNDEBUG") .
@@ -298,7 +298,6 @@ sub run
($self->{bDebugTestTrace} && $self->{bDebug} ? " \\\n\t-DDEBUG_TEST_TRACE" : '') .
(vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? " \\\n\t-DWITH_BACKTRACE" : '') .
($self->{oTest}->{&TEST_CDEF} ? " \\\n\t$self->{oTest}->{&TEST_CDEF}" : '') .
" -DERROR_MESSAGE_BUFFER_SIZE=131072\n" .
"\n" .
"\n" .
"CFLAGS_TEST =" .

View File

@@ -531,7 +531,7 @@ eval
&log(INFO, "autogenerate code");
# Build code
executeTest("CFLAGS='-Wfatal-errors -g' make -C ${strBuildPath} build-config build-error build-help");
executeTest("make -C ${strBuildPath} build-config build-error build-help");
if ($bGenOnly)
{
@@ -693,7 +693,6 @@ eval
# Build configure/compile options and see if they have changed from the previous build
my $strCFlags =
"-Wfatal-errors -g" .
(vmWithBackTrace($strBuildVM) && $bBackTrace ? ' -DWITH_BACKTRACE' : '') .
($bDebugTestTrace ? ' -DDEBUG_TEST_TRACE' : '');
my $strLdFlags = vmWithBackTrace($strBuildVM) && $bBackTrace ? '-lbacktrace' : '';