[commit: ghc] master: Make sure ./configure tests valid C99 programs. Issue #7678. (213e1c7)

Austin Seipp mad.one at gmail.com
Sun Feb 10 09:40:56 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/213e1c71e8c574e989f463ca623bef6d2dcccea6

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

commit 213e1c71e8c574e989f463ca623bef6d2dcccea6
Author: Austin Seipp <aseipp at pobox.com>
Date:   Sun Feb 10 02:22:29 2013 -0600

    Make sure ./configure tests valid C99 programs. Issue #7678.
    
    Clang gives a big fat warning that there's no return value for the
    statement, since the prototype defaults to 'int'.
    
    Signed-off-by: Austin Seipp <aseipp at pobox.com>

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

 aclocal.m4 |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 32af656..d134028 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -893,7 +893,7 @@ AC_SUBST(Alex3)
 AC_DEFUN([FP_PROG_LD_FLAG],
 [
 AC_CACHE_CHECK([whether ld understands $1], [fp_cv_$2],
-[echo 'foo() {}' > conftest.c
+[echo 'int foo() { return 0; }' > conftest.c
 ${CC-cc} -c conftest.c
 if ${LdCmd} -r $1 -o conftest2.o conftest.o > /dev/null 2>&1; then
    fp_cv_$2=$1
@@ -934,7 +934,7 @@ FP_PROG_LD_FLAG([--reduce-memory-overheads],[LdReduceMemoryOverheads])
 AC_DEFUN([FP_PROG_LD_BUILD_ID],
 [
 AC_CACHE_CHECK([whether ld understands --build-id], [fp_cv_ld_build_id],
-[echo 'foo() {}' > conftest.c
+[echo 'int foo() { return 0; }' > conftest.c
 ${CC-cc} -c conftest.c
 if ${LdCmd} -r --build-id=none -o conftest2.o conftest.o > /dev/null 2>&1; then
    fp_cv_ld_build_id=yes
@@ -975,7 +975,7 @@ AC_SUBST([LdIsGNULd], [`echo $fp_cv_gnu_ld | sed 'y/yesno/YESNO/'`])
 AC_DEFUN([FP_PROG_LD_NO_COMPACT_UNWIND],
 [
 AC_CACHE_CHECK([whether ld understands -no_compact_unwind], [fp_cv_ld_no_compact_unwind],
-[echo 'foo() {}' > conftest.c
+[echo 'int foo() { return 0; }' > conftest.c
 ${CC-cc} -c conftest.c
 if ${LdCmd} -r -no_compact_unwind -o conftest2.o conftest.o > /dev/null 2>&1; then
    fp_cv_ld_no_compact_unwind=yes





More information about the ghc-commits mailing list