Commit 192dd068 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by Ben Gamari

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:

GHC Trac Issues: #7660
parent d585073d
......@@ -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"],
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment