tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] pointers to static functions inside a static table


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] pointers to static functions inside a static table
Date: Mon, 30 Aug 2010 16:45:50 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-5-686; KDE/4.4.5; i686; ; )

Le vendredi 27 août 2010 12:47:35, Aharon Robbins a écrit :
> Hi. I've reported this before, but here is a small test case:
> 
> $ cat foo.c
> #include <stdio.h>
> 
> static void func();
> 
> int main(int argc, char **argv)
> {
>       static struct s {
>               void (*elem)();
>       } t[] = {
>               { func }        /* tcc requires these braces! */
>       };
> 
>       printf("func is %p, t[0].func is %p\n", func, t[0].elem);
>       return 0;
> }
> 
> static void func()
> {
>       int x = 1;
>       x++;
> }
> 
> $ gcc foo.c ; ./a.out
> func is 0x4004f8, t[0].func is 0x4004f8
> $ tcc foo.c ; ./a.out
> func is 0x8048314, t[0].func is (nil)

Sorry but I can't reproduce the bug. I've just checked out the mob branch and 
it does what it's suppose to do. Could you tell me what's the latest commit in 
your local mob branch? Mine is 9d347f87426aebabe4eb52207b2f9ea8d2274809 
(latest commit when I wrote this email).

[SNIP]
> 
> Thanks!
> 
> Arnold Robbins
Best regards,

Thomas Preud'homme
> 
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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