Milan Jurik wrote:
> Roland Mainz p????e v po 02. 03. 2009 v 05:38 +0100:
> > This is a sponsor request to "fix" ([1]) CR #6799167
> > ( - "real gcc
> > build fails in libshell").
> >
> > [1]=The "fix" is more a workaround since I don't know exactly how the
> > ctf*-tools can be fixed.
> >
> > My contributor ID is "OS0025".
> >
> > Webrev follows later when my "hg clone" is complete...
> I will sponsor it (if it's ksh93 issue).

It's an issue in the ctf*-tools but we failed to find a fix for these
tools for more than a month and IMO breaking the gcc build for such a
long time IMO not acceptable. Since I don't know how to fix the ctf
tools the patch in
works around the problem by using an arithmetric expression in the VLA
declaration which seems to work in this case.

To explain the workaround: The following testcase causes "ctfconvert" to
fail with the error "die 8002: failed to get unsigned (form 0x13)":
-- snip --
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int ac, char *av[])
   int len=strlen(av[0])+1;
   char name[len];

   strcpy(name, av[0]);

   printf("name='%s'\n", name);

   return EXIT_SUCCESS;
-- snip --

The problem goes away if I replace the first two lines of the |main()|
function like this...
-- snip --
   int len=strlen(av[0]);
   char name[len+1];
-- snip --
... e.g. VLA declarations seem to work if you use an arithemtric
expression instead of a plain variable... but I can't explain _why_ this
works... ;-(



  __ .  . __
 (o.\ \/ /.o) roland.mainz at
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to