zsh-workers
 help / color / mirror / code / Atom feed
From: Tomi Vainio - Sun Finland <Tomi.Vainio@Sun.COM>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@sunsite.dk
Subject: Re: 4.1.1 doesn't compile
Date: Wed, 25 Jun 2003 16:04:42 +0300	[thread overview]
Message-ID: <16121.40426.895830.486936@ultrahot.finland.sun.com> (raw)
In-Reply-To: <16121.36471.200540.460093@ultrahot.finland.sun.com>

 > Oliver Kiddle writes:
 > Tomi Vainio - Sun Finland wrote:
 > > I also found another problem but this time only when I try to compile
 > > 32bit binary.
 > > 
 > > Compiler is Sun ONE Studio 8, Compiler Collection
 >           cc: Sun C 5.5 Patch 112760-01 2003/05/18 
 > > 
 > > cc -c -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -xO4  -o compat.o compat.c
 > > "compat.c", line 441: variable length array can not be declared with a static storage class: llbuf
 > > cc: acomp failed for compat.c
 > 
 > This I can't reproduce. The compiler I have is older than that.
 > 
 > The line in question is:
 >      static char llbuf[DIGBUFSIZE];
 > and system.h defines:
 >      #define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 0.30103) + 3)
 > 
 > So quite why the compiler thinks it has a variable length array I
 > don't understand. Could you perhaps try substituting that in directly
 > and see if you can tweak it to work. The int cast might be causing the
 > problem in which case the * 0.30103 could perhaps be changed to * 30103
 > / 100000. But I don't understand what the calculation is doing. Anyone
 > else have any idea?
 > 
I found our bug report about this same thing.  There is a lot of talk
about C90 and C99 standards and how this should really work.

BugID 4800684 compiler treats a usual array as VLA
      4841119 zsh needs a minor fix to build with latest k2 compiler

Work Around
Use -xc99=%none options if C99 features are not required.

or

system.h line 421
- #define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 0.30103) + 3)
+ #define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 30103/100000) + 3)


  Tomppa


  reply	other threads:[~2003-06-25 13:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-24 13:31 Tomi Vainio - Sun Finland
2003-06-24 15:29 ` Oliver Kiddle
2003-06-25  8:20   ` Tomi Vainio - Sun Finland
2003-06-25  9:48     ` Oliver Kiddle
2003-06-25 11:58       ` Tomi Vainio - Sun Finland
2003-06-25 13:04         ` Tomi Vainio - Sun Finland [this message]
2003-06-25 13:45           ` Oliver Kiddle
2003-06-25 16:32       ` Bart Schaefer
2003-06-26 11:23       ` Zefram
2003-06-27 11:08         ` Tomi Vainio - Sun Finland

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=16121.40426.895830.486936@ultrahot.finland.sun.com \
    --to=tomi.vainio@sun.com \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.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).