Re: [Tinycc-devel] TCC crashes on invalid structure reference

2007-11-13 Thread Marc Andre Tanner
KHMan wrote: Mike wrote: See the attached crash.c. Compile with tcc crash.c The last LGPL version of Rob's tree, now on: http://hg.sharesource.org/mercurialtcc I tested crash.c on Ubuntu 6.10, works. tcc reported ',' expected at line 12, which I believe is correct behaviour. As i

[Tinycc-devel] Strange sizeof construct

2007-11-13 Thread Marc Andre Tanner
Hi, Could a C guru out there please tell me why the following works? Extra points if you can explain why it makes sense. #include stdio.h int main(){ int arr[10]; printf(%d\n,sizeof arr[0]); // ok printf(%d\n,sizeof(arr[0])); // ok printf(%d\n,sizeof(arr)[0]);

[Tinycc-devel] [PATCH] ignore #ident preprocessor directive

2007-11-13 Thread Marc Andre Tanner
Hi, The following patch makes tcc ignore the the #ident preprocessor command. Marc -- Marc Andre Tanner http://www.brain-dump.org/ GPG key: CF7D56C0 diff -r 41841f0acc48 tcc.c --- a/tcc.c Wed Oct 03 18:15:48 2007 -0500 +++ b/tcc.c Tue Nov 13 12:30:31 2007 +0100 @@ -2194,6 +2194,9 @@ static

Re: [Tinycc-devel] Strange sizeof construct

2007-11-13 Thread Simon 'corecode' Schubert
Marc Andre Tanner wrote: Could a C guru out there please tell me why the following works? Extra points if you can explain why it makes sense. #include stdio.h int main(){ int arr[10]; printf(%d\n,sizeof arr[0]); // ok printf(%d\n,sizeof(arr[0])); // ok

Re: [Tinycc-devel] Strange sizeof construct

2007-11-13 Thread grischka
Could a C guru out there please tell me why the following works? Extra points if you can explain why it makes sense. #include stdio.h int main(){ int arr[10]; printf(%d\n,sizeof arr[0]); // ok printf(%d\n,sizeof(arr[0])); // ok printf(%d\n,sizeof(arr)[0]); // ok, but why? return 0;

Re: [Tinycc-devel] Strange sizeof construct

2007-11-13 Thread Chris Lattner
On Nov 13, 2007, at 3:39 PM, grischka wrote: Could a C guru out there please tell me why the following works? Extra points if you can explain why it makes sense. #include stdio.h int main(){ int arr[10]; printf(%d\n,sizeof arr[0]); // ok printf(%d\n,sizeof(arr[0])); // ok

Re: [Tinycc-devel] [PATCH] ignore #ident preprocessor directive

2007-11-13 Thread Sanghyeon Seo
2007/11/14, Marc Andre Tanner [EMAIL PROTECTED]: The following patch makes tcc ignore the the #ident preprocessor command. FYI, GCC documentation on this strange directive. http://gcc.gnu.org/onlinedocs/cpp/Other-Directives.html -- Seo Sanghyeon

Re: [Tinycc-devel] [PATCH] Check for duplicate definitions of variables

2007-11-13 Thread KHMan
Joshua Phillips wrote: oops, slight mistake, sorry. Here is replacement patch. -- I was going to send this as a high-tech Mercurial bundle, but then I realized I'd transplanted the parent, so it was a bit difficult. Here's a low-tech patch file instead. Check for duplicate

Re: [Tinycc-devel] [PATCH] ignore #ident preprocessor directive

2007-11-13 Thread KHMan
Sanghyeon Seo wrote: 2007/11/14, Marc Andre Tanner [EMAIL PROTECTED]: The following patch makes tcc ignore the the #ident preprocessor command. FYI, GCC documentation on this strange directive. http://gcc.gnu.org/onlinedocs/cpp/Other-Directives.html Thanks, I'll add that to the changeset