diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-11-21 15:48:49 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-11-21 15:48:49 +0100 |
commit | 192dd068890701a7692890677d4cbf9f2abdb64a (patch) | |
tree | bf591b96fbaa1b5f3d69381bef98f45d975c3e7c | |
parent | d585073d582d82fae80781dc23176b1ef59527a9 (diff) | |
download | haskell-192dd068890701a7692890677d4cbf9f2abdb64a.tar.gz |
Suppress conflicting types for builtins warnings
GCC 4.0 and later warn about type-conflicting prototypes for built-in
functions such as `strlen`. This is a problem for the via-c backend as
it generates code such as
typedef void *(*(*StgFunPtr)(void))(void);
extern StgFunPtr strlen();
However, by using the `-fno-builtin` flag, GCC is told not to try to
auto-detect such built-in functions and instead treat them as ordinary
external functions. This also suppresses this warning.
This address #7660
Test Plan: IIAM
Reviewers: bgamari, austin
Reviewed By: austin
Subscribers: thomie, erikd
Differential Revision: https://phabricator.haskell.org/D1506
GHC Trac Issues: #7660
-rw-r--r-- | aclocal.m4 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 0c8252c842..e0cd330555 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1436,6 +1436,9 @@ AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_ FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [3.4], [fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fwrapv"], []) + FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [4.0], + [fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-builtin"], + []) ]) AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts) ]) |