Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 205F99252 for ; Wed, 25 Apr 2012 19:34:05 +0000 (UTC) Received: (qmail 36809 invoked by uid 500); 25 Apr 2012 19:34:04 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 36712 invoked by uid 500); 25 Apr 2012 19:34:04 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 36699 invoked by uid 99); 25 Apr 2012 19:34:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 19:34:04 +0000 X-ASF-Spam-Status: No, hits=0.4 required=5.0 tests=SPF_PASS,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [176.9.216.40] (HELO furnace.wzff.de) (176.9.216.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 19:33:56 +0000 Received: from xdsl-188-155-204-150.adslplus.ch ([188.155.204.150] helo=[172.16.0.230]) by furnace.wzff.de with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1SN7y2-0007KW-0t for dev@apr.apache.org; Wed, 25 Apr 2012 21:33:35 +0200 Message-ID: <4F9852C9.3070106@barfooze.de> Date: Wed, 25 Apr 2012 21:38:49 +0200 From: John Spencer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Mail/1.0 MIME-Version: 1.0 To: dev@apr.apache.org Subject: broken ac_fn_c_check_type function in configure script Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org this check has 2 issues: a) it does the check twice if the first test succeeds, wasting precious time b) it uses sizeof(( $2 )) in the second ac_fn_c_try_compile invocation which is invalid C root:/src$ cat test.c typedef unsigned long size_t; int main () { if (sizeof ((size_t))) return 0; return 0; } root:/src$ gcc test.c test.c: In function 'main': test.c:3:22: error: expected expression before ')' token here's the extracted function from version 1.4.6 configure script # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type --JS