Skip to content

Commit

Permalink
Sets -Wno-error=address-of-packed-member built with GCC9
Browse files Browse the repository at this point in the history
See also frugalos#10.
  • Loading branch information
shinnya committed Jul 7, 2019
1 parent ec65c94 commit d5113d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ cd liberasurecode/
git checkout 1.5.0
./autogen.sh
CFLAGS="-I${BUILD_DIR}/jerasure/include -I${BUILD_DIR}/include"
# Since gcc9, gcc reports warnings about taking the address of a packed member.
# jerasure uses autoconf and autoconf looks for gcc and cc at first if CC is not set in the environment.
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/C-Compiler.html for more details.
if type gcc > /dev/null 2>&1; then
GCC_MAJOR_VERSION=$(gcc -dumpversion | cut -f 1 -d '.')
if [ $GCC_MAJOR_VERSION -ge 9 ]; then
CFLAGS="$CFLAGS -Wno-error=address-of-packed-member"
fi
fi
if [ "$(uname)" == "Darwin" ]; then
CFLAGS="$CFLAGS -Wno-error=address-of-packed-member"
fi
Expand Down

0 comments on commit d5113d7

Please sign in to comment.