zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: compstate[nmatches]
Date: 14 Oct 1999 04:05:33 +0900	[thread overview]
Message-ID: <rsq3dvfrshu.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Wed, 13 Oct 1999 11:46:35 +0200 (MET DST)"

In article <199910130946.LAA12312@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> 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


  parent reply	other threads:[~1999-10-13 19:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-13  9:46 Sven Wischnowsky
1999-10-13 14:52 ` Bart Schaefer
1999-10-13 14:56 ` Bart Schaefer
1999-10-13 15:13   ` Bart Schaefer
1999-10-13 19:05 ` Tanaka Akira [this message]
1999-10-14  6:24 Sven Wischnowsky
1999-10-14  7:50 ` Bart Schaefer
1999-10-14  8:32 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rsq3dvfrshu.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).