From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24121 invoked from network); 13 Oct 1999 19:05:47 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Oct 1999 19:05:47 -0000 Received: (qmail 15793 invoked by alias); 13 Oct 1999 19:05:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8241 Received: (qmail 15785 invoked from network); 13 Oct 1999 19:05:36 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: compstate[nmatches] References: <199910130946.LAA12312@beta.informatik.hu-berlin.de> MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 14 Oct 1999 04:05:33 +0900 In-Reply-To: Sven Wischnowsky's message of "Wed, 13 Oct 1999 11:46:35 +0200 (MET DST)" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article <199910130946.LAA12312@beta.informatik.hu-berlin.de>, Sven Wischnowsky writes: > -static int nmatches, smatches; > +/**/ > +int nmatches, smatches; > VARARR(int, mlens, nmatches + 1); This change tickle a gcc bug. % gcc -c -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -DMODULE -Wall -Wno-implicit -Wmissing-prototypes -ggdb -fpic -o zle_tricky..o zle_tricky.c zle_tricky.c: In function `calclist': zle_tricky.c:8804: size of array `mlens' is too large zle_tricky.c:8804: warning: unused variable `mlens' zsh: exit 1 gcc -DHAVE_VARIABLE_LENGTH_ARRAYS -c -I. -D_LARGEFILE_SOURCE -DHAVE_CONFIG_H It is reproducible with more simple program as: Z(2):akr@is27e1u11% cat tst.c int num; void fun(void) { int arr[num + 1]; } Z(2):akr@is27e1u11% gcc -c tst.c tst.c: In function `fun': tst.c:5: size of array `arr' is too large zsh: exit 1 gcc -c tst.c At least, gcc-2.8.1 and 2.95.1 has the problem. But gcc-2.7.2.3 has no problem. Although I sent a bug report to gcc developpers, zsh should check it. Index: configure.in =================================================================== RCS file: /projects/zsh/zsh/configure.in,v retrieving revision 1.1.1.28 diff -u -F^( -r1.1.1.28 configure.in --- configure.in 1999/10/06 19:45:06 1.1.1.28 +++ configure.in 1999/10/13 18:53:55 @@ -367,7 +367,7 @@ dnl Checking if the compiler supports variable-length arrays AC_CACHE_CHECK(if the compiler supports variable-length arrays, zsh_cv_c_variable_length_arrays, -[AC_TRY_COMPILE([int foo();], [int i[foo()];], +[AC_TRY_COMPILE([int foo(), n;], [int i[foo()], a[n+1];], zsh_cv_c_variable_length_arrays=yes, zsh_cv_c_variable_length_arrays=no)]) if test $zsh_cv_c_variable_length_arrays = yes; then -- Tanaka Akira