[commit: ghc] master: Suppress conflicting types for builtins warnings (192dd06)

git at git.haskell.org git at git.haskell.org
Sat Nov 21 16:15:42 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/192dd068890701a7692890677d4cbf9f2abdb64a/ghc

>---------------------------------------------------------------

commit 192dd068890701a7692890677d4cbf9f2abdb64a
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Nov 21 15:48:49 2015 +0100

    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


>---------------------------------------------------------------

192dd068890701a7692890677d4cbf9f2abdb64a
 aclocal.m4 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/aclocal.m4 b/aclocal.m4
index 0c8252c..e0cd330 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)
 ])



More information about the ghc-commits mailing list