Skip to content

Commit

Permalink
Ignore GCC 8's -Wstringop-truncation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kholia committed Jul 31, 2018
1 parent 46886f8 commit 9ea7ed2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ elif [[ "$TEST" == "fresh test" ]]; then
docker run -v $HOME:/root -v $(pwd):/cwd ubuntu:rolling sh -c " \
cd /cwd/src; \
apt-get update -qq; \
apt-get install -y build-essential libssl-dev yasm libgmp-dev libpcap-dev pkg-config debhelper libnet1-dev libbz2-dev libomp-dev; \
apt-get install -y build-essential libssl-dev yasm libgmp-dev libpcap-dev pkg-config debhelper libnet1-dev libbz2-dev zlib1g-dev libomp-dev; \
gcc --version; \
./configure --enable-werror --enable-asan; \
make -sj4; \
export OPENCL="""$OPENCL"""; \
Expand Down
49 changes: 49 additions & 0 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -6286,6 +6286,55 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu


if test 1 -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wno-stringop-truncation" >&5
$as_echo_n "checking if $CC supports -Wno-stringop-truncation... " >&6; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

ac_saved_cflags="$CFLAGS"
CFLAGS="-Werror -Wno-stringop-truncation"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if test "1" -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
CFLAGS_EX="$CFLAGS_EX -Wno-stringop-truncation"

else
if test 1 -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "1" = 2; then :
as_fn_error $? "Not supported by compiler" "$LINENO" 5
fi

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$ac_saved_cflags"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu



fi
if test "x$asan" = xyes || test "x$ubsan" = xyes || test "x$ubsantrap" ; then
Expand Down
1 change: 1 addition & 0 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ fi
JTR_FLAG_CHECK([-Werror], 1)
JTR_FLAG_CHECK([-Wno-error=cpp], 1)
JTR_FLAG_CHECK([[-Wno-error=#warnings]], 1)
JTR_FLAG_CHECK([[-Wno-stringop-truncation]], 1)
)
if test "x$asan" = xyes || test "x$ubsan" = xyes || test "x$ubsantrap" ; then
JTR_FLAG_CHECK([-fno-omit-frame-pointer], 1)
Expand Down

0 comments on commit 9ea7ed2

Please sign in to comment.