[prev in list] [next in list] [prev in thread] [next in thread]
List: pcc-list
Subject: Re: x86 local.c clocal and C99
From: Otto Moerbeek <otto () drijf ! net>
Date: 2007-09-26 11:18:25
Message-ID: Pine.BSO.4.64.0709261316570.23018 () lou ! intra ! drijf ! net
[Download RAW message or body]
On Wed, 26 Sep 2007, TAKAHASHI Tamotsu wrote:
> Hi,
> Thanks for your great work!
> Here is another bug report.
>
> Synopsis: Compile error with variable-length array
> Priority: low
> Standard: C99
>
> This C99 program causes cerror("bad conversion"):
>
> int main(void) {
> int n=1;
> int a[1][n];
> a[0][0]=1; /* this line */
> return 0;
> }
>
> and this diff makes it work:
>
> --- arch/x86/local.c 24 Sep 2007 17:56:17 -0000 1.3
> +++ arch/x86/local.c 25 Sep 2007 12:41:17 -0000
> @@ -280,7 +280,7 @@ clocal(NODE *p)
>
> case PMCONV:
> case PVCONV:
> - if( p->n_right->n_op != ICON ) cerror( "bad conversion", 0);
> + if( p->n_right->n_op != ICON ) werror( "bad conversion", 0);
> nfree(p);
> return(buildtree(o==PMCONV?MUL:DIV, p->n_left, p->n_right));
>
>
> In fact, the corresponding cerror in arch/pdp10/local.c
> is commented out.
I'd say nothing is wrong with the test case, so pcc should not issue
any message.
-Otto
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic