Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements

2016-03-11 Thread Michael B. Smith
I am a rare poster here – but I think your patch leads to all sorts of problems. Please revert it/don’t commit it. From: tinycc-devel-bounces+michael=theessentialexchange@nongnu.org [mailto:tinycc-devel-bounces+michael=theessentialexchange@nongnu.org] On Behalf Of Amine Najahi Sent:

Re: [Tinycc-devel] Alternative tokens for C-application

2016-03-11 Thread Ben Bacarisse
Michael Matz writes: > Ben, have you finished the patch? If so, please post here, have you > measured compile time to be unaffected (would be bad if such a seldom > used feature would cause a slowdown)? I've not measure but I'd be surprised if there were much impact.

Re: [Tinycc-devel] Alternative tokens for C-application

2016-03-11 Thread Michael Matz
Hi, On Thu, 10 Mar 2016, Мельников Алексей wrote: --> Urgs. Are you really using digraphs in any production code? --> (Yes, tcc tries to support c99, but, well, I mean, digraphs? Seriously? If you use EBCDIC you have more serious problems with tcc I guess, and if you don't, why use

Re: [Tinycc-devel] tccgen.c: off by one in flexible array members

2016-03-11 Thread Michael Matz
Hi, On Fri, 11 Mar 2016, Michael Matz wrote: This whole thing also points out some deficiencies of tcc to emit error messages. For instance it accepts the initialization void f(void) { struct w q = {"bugs", { 'c' } }; } (and sets ref->c to 1), even though this is a non-static

Re: [Tinycc-devel] tccgen.c: off by one in flexible array members

2016-03-11 Thread Michael Matz
Hi, On Fri, 11 Mar 2016, Michael Matz wrote: it's now "size += -1 * 4 + 1" (i.e. +=3). -=3 of course, but you got the idea :) So, I think it's more correct to special case the ref->c == -1 case only (don't adjust size in that case), instead of playing +-1 tricks (as in, it's not a

Re: [Tinycc-devel] tccgen.c: off by one in flexible array members

2016-03-11 Thread Michael Matz
Hi, On Wed, 9 Mar 2016, Henry Kroll wrote: I created a + 1 patch that seems to work, but I need to run more tests before committing. = diff --git a/tccgen.c b/tccgen.c index 3cd28ed..270d11c 100644 --- a/tccgen.c +++ b/tccgen.c @@ -5847,7

Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements

2016-03-11 Thread Michael Matz
Hi, On Fri, 11 Mar 2016, Amine Najahi wrote: > Perhaps surprisingly, correcting this bug is quite costly. Here is a > tentative patch. I find it messy but working with dynamic data and > passing the cases to the block function are necessary to handle an > "unlimited number" of cases and

Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements

2016-03-11 Thread Amine Najahi
Hi Arnold and tcc folks, Perhaps surprisingly, correcting this bug is quite costly. Here is a tentative patch. I find it messy but working with dynamic data and passing the cases to the block function are necessary to handle an "unlimited number" of cases and nested switch blocks. Also, since