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 be an integer constant
expression and no two of the case constant expressions in the same
switch statement shall have the same value after conversion.

Section 4 paragraph 2:
If a "shall" or "shall not" requirement that appears outside of a
constraint or runtime-constraint is violated, the behavior is undefined.

There you read it, C11 allows us to generate whatever we want.

This is true. But you missed the detail that all constraint violations require a diagnostic (5.1.1.3), and the above citation is a constraint on switches. So, yes, TCC is not conforming :)


Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to