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

2016-03-14 Thread Michael B. Smith
: Sunday, March 13, 2016 11:40 PM To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements Amine Najahi <mohami...@gmail.com> wrote: > Hi, > > The patch is not committed. It is just a hackish way I coded to > expl

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

2016-03-14 Thread Michael Matz
Hi, On Sun, 13 Mar 2016, arn...@skeeve.com wrote: > Whoever it was that posted the note about the standard requiring a > diagnostic was right on target. It was me ... > This is too fundamental a mistake not to diagnose. ... making a concious decision to conditionally disagree with you

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

2016-03-13 Thread arnold
el=theessentialexchange@nongnu.org > > [mailto:tinycc-devel-bounces+michael=theessentialexchange@nongnu.org] > > *On > > Behalf Of *Amine Najahi > > *Sent:* Friday, March 11, 2016 12:13 PM > > *To:* tinycc-devel@nongnu.org > > *Subject:* Re: [Tinycc-devel] MAJ

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

2016-03-13 Thread Amine Najahi
12:13 PM > *To:* tinycc-devel@nongnu.org > *Subject:* Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate > cases in switch statements > > > > Hi Arnold and tcc folks, > > > > Perhaps surprisingly, correcting this bug is quite costly. > > Here is a tentat

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

2016-03-13 Thread Joel Bodenmann
eli...@orange.fr> Sent: Sunday, March 13, 2016 10:45 AM To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements >In ideal world, a [C] compiler should be: >- extremely fast to compile your code (i.e. very nervous develo

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

2016-03-12 Thread Michael Matz
Hi, On Sat, 12 Mar 2016, Daniel Glöckner wrote: The issue isn't just the lack of diagnostic - what kind of erroneous code is being generated in this case? Let's see what the final C11 draft (N1570) says about this issue: Section 6.8.4.2 paragraph 3: The expression of each case label shall

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

2016-03-12 Thread Michael Matz
Hi, On Sat, 12 Mar 2016, arn...@skeeve.com wrote: First, the bug can't be as MAJOR as the subject wants to make us believe. After all it wasn't noticed since the last $MANY years. The bug caused me to push bad code to gawk's repo. I assumed something like that. It still doesn't make the

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

2016-03-12 Thread Daniel Glöckner
On Sat, Mar 12, 2016 at 10:58:42AM -0700, arn...@skeeve.com wrote: > The bug caused me to push bad code to gawk's repo. It's only luck that it > wasn't noticed, but a bug is a bug. So you have personal feelings towards that bug. I'd never use TinyCC for serious development. There are simply not

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

2016-03-12 Thread arnold
Michael Matz wrote: > First, the bug can't be as MAJOR as > the subject wants to make us believe. After all it wasn't noticed since > the last $MANY years. The bug caused me to push bad code to gawk's repo. It's only luck that it wasn't noticed, but a bug is a bug.

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

2016-03-11 Thread Michael B. Smith
: Friday, March 11, 2016 12:13 PM To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements Hi Arnold and tcc folks, Perhaps surprisingly, correcting this bug is quite costly. Here is a tentative patch. I find it messy but working

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

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

2016-03-10 Thread arnold
Hi All. On the latest mob: $ cat foo.c int main(int argc, char**argv) { int a; switch (a) { case 1: case 2: break; case 3: break; case 1: break; default: break; }