tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Array BUG


From: pancake
Subject: Re: [Tinycc-devel] Array BUG
Date: Mon, 15 Mar 2010 11:30:51 +0100
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

this code doesnt compiles with gcc ,the bug is because tcc allows to compile such expressions?

can you explain it better?

a.c: In function ‘main’:
a.c:8: warning: format ‘%X’ expects type ‘unsigned int’, but argument 2 has type ‘int *’ a.c:8: warning: format ‘%X’ expects type ‘unsigned int’, but argument 3 has type ‘int *’
a.c:10: error: invalid use of array with unspecified bounds
a.c:10: error: invalid use of array with unspecified bounds
a.c:10: warning: format ‘%X’ expects type ‘unsigned int’, but argument 2 has type ‘pList’ a.c:10: warning: format ‘%X’ expects type ‘unsigned int’, but argument 3 has type ‘pList’

Alexei wrote:
#include <stdio.h>
int arr[2];
typedef int    List[];
typedef List* pList; pList pa;
int main(int argc, char **argv)
{
  printf("[0]=%X [1]=%X\n",&arr[0],&arr[1]);
  pa = &arr;
  printf("[0]=%X [1]=%X\n",&pa[0],&pa[1]);
}
Runtime:
[0]=4020D0 [1]=4020D4
[0]=4020D0 [1]=4020CC



_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]