Skip to content

Commit

Permalink
configure: move -fexcess-precision=standard to the internal cflags (o…
Browse files Browse the repository at this point in the history
…caml#9496)

Follow-up to c5afa93.

The GCC option -fexcess=precision is supported for C but not for C++.

Some users use ocamlc -c or ocamlopt -c to compile C++ source files,
causing errors since -fexcess-precision=standard was added to the
common C flags in commit c5afa93.

This commit moves -fexcess-precision=standard to the internal C flags,
so that ocamlc -c and ocamlopt -c will not apply it to C / C++ source files.

(cherry picked from commit 4d3b431)
  • Loading branch information
xavierleroy committed Apr 24, 2020
1 parent ff98901 commit 9b96596
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -12497,10 +12497,10 @@ case $host in #(
gcc-[01234]-*) :
as_fn_error $? "This version of Mingw GCC is too old. Please use GCC version 5 or above." "$LINENO" 5 ;; #(
gcc-*) :
internal_cflags="-Wno-unused $gcc_warnings"
internal_cflags="-Wno-unused $gcc_warnings \
-fexcess-precision=standard"
# TODO: see whether the code can be fixed to avoid -Wno-unused
common_cflags="-O2 -fno-strict-aliasing -fwrapv \
-fexcess-precision=standard -mms-bitfields"
common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields"
internal_cppflags='-DUNICODE -D_UNICODE'
internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE="
internal_cppflags="${internal_cppflags}\$(WINDOWS_UNICODE)" ;; #(
Expand Down Expand Up @@ -12532,12 +12532,12 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;};
internal_cflags="$gcc_warnings" ;; #(
gcc-4-*) :
common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
-fno-builtin-memcmp -fexcess-precision=standard";
internal_cflags="$gcc_warnings" ;; #(
-fno-builtin-memcmp";
internal_cflags="$gcc_warnings -fexcess-precision=standard" ;; #(
gcc-*) :
common_cflags="-O2 -fno-strict-aliasing -fwrapv \
-fexcess-precision=standard";
internal_cflags="$gcc_warnings -fno-common" ;; #(
common_cflags="-O2 -fno-strict-aliasing -fwrapv";
internal_cflags="$gcc_warnings -fno-common \
-fexcess-precision=standard" ;; #(
msvc-*) :
common_cflags="-nologo -O2 -Gy- -MD"
common_cppflags="-D_CRT_SECURE_NO_DEPRECATE"
Expand Down
16 changes: 8 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,10 @@ AS_CASE([$host],
[AC_MSG_ERROR(m4_normalize([This version of Mingw GCC is too old.
Please use GCC version 5 or above.]))],
[gcc-*],
[internal_cflags="-Wno-unused $gcc_warnings"
[internal_cflags="-Wno-unused $gcc_warnings \
-fexcess-precision=standard"
# TODO: see whether the code can be fixed to avoid -Wno-unused
common_cflags="-O2 -fno-strict-aliasing -fwrapv \
-fexcess-precision=standard -mms-bitfields"
common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields"
internal_cppflags='-DUNICODE -D_UNICODE'
internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE="
internal_cppflags="${internal_cppflags}\$(WINDOWS_UNICODE)"],
Expand Down Expand Up @@ -587,12 +587,12 @@ AS_CASE([$host],
internal_cflags="$gcc_warnings"],
[gcc-4-*],
[common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
-fno-builtin-memcmp -fexcess-precision=standard";
internal_cflags="$gcc_warnings"],
-fno-builtin-memcmp";
internal_cflags="$gcc_warnings -fexcess-precision=standard"],
[gcc-*],
[common_cflags="-O2 -fno-strict-aliasing -fwrapv \
-fexcess-precision=standard";
internal_cflags="$gcc_warnings -fno-common"],
[common_cflags="-O2 -fno-strict-aliasing -fwrapv";
internal_cflags="$gcc_warnings -fno-common \
-fexcess-precision=standard"],
[msvc-*],
[common_cflags="-nologo -O2 -Gy- -MD"
common_cppflags="-D_CRT_SECURE_NO_DEPRECATE"
Expand Down

0 comments on commit 9b96596

Please sign in to comment.