On Sat, 11 Mar 2023, 12:53 Basile Starynkevitch, <bas...@starynkevitch.net>
wrote:

> Hello all,
>
>
> Andrea observed that:
>
> In gcc 8.3.0, compiling
>
>
> enum
> test
>    {
>      FIRST = 1,
>      SECOND = 1,
>      THIRD = 2
>    };
>
> int
> main (void)
> {
>    return 0;
> }
>
>
> generates no warning even with -Wextra.
>
> I believe that the C standard (which I don't have here, but see also
> https://port70.net/~nsz/c/c11/n1570.html or buy it from ISO) explicitly
> allow duplicate values in enum.
>


Of course it does, it's perfectly valid. Nobody has said it should be
rejected. The request is for a warning, because for *some* uses of enums
duplicates are not wanted.

Reply via email to