From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 91B833858D1E for ; Mon, 13 Mar 2023 13:30:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 91B833858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678714243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mn23X+5MDMZpQ69P8XynP9X7J86P2kSwQgf3f9Cy8pg=; b=cY+YH6CY7nkVkmqT4YhnVa4OKzb2acQrce5RNHGAFd4XgkogVEC+xwLXjxFB3aan3QW5AT 6+dyznSxfoGKHG6mGtuzFgafPJhAsFTf97XuwvsVvBQVg8Lcg5xJHYFI5Uq3BezSiSuYDy uerECOm0UPSmL60xPYDu3Exx4RZ9Ols= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-9wRxtLqwPxafBdDlU-SUdQ-1; Mon, 13 Mar 2023 09:30:41 -0400 X-MC-Unique: 9wRxtLqwPxafBdDlU-SUdQ-1 Received: by mail-qk1-f199.google.com with SMTP id d72-20020ae9ef4b000000b0072db6346c39so6536030qkg.16 for ; Mon, 13 Mar 2023 06:30:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678714241; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mn23X+5MDMZpQ69P8XynP9X7J86P2kSwQgf3f9Cy8pg=; b=DYuKR9k6EOI5zeD8QArXl7TFP3at13NWP3VX6DRmktBdgGMH4xwcLx3OMnW9uNI2qs 6QLxoKXT/4WmzgpQrK9elaXRgHiKIrZ5nMnnuTeHCFmNHj/qNwCvjTuAdYn4pP3/6E/q BbItZYdTRqMcr2LyZ3cERNzFUjmtVxnMdXLqO+DYmzb9ofb+FfQvtWJ54PCvWWTQbexz lZr1xcs3MzMnolS9Hbpulp+lP3vJSF9R/gVu32Lcmxg8d/ATmcXNyHe+mjBRe3oIoTbs 6RKuU2nFQUUvY6jrpJEIDd48I113vZsQXzj9nyx/9wN2cmT8LMRIxWyKqiCIyGXeGKlD xIaw== X-Gm-Message-State: AO0yUKUgD3BVtdN7XUKnT1q51nL//ANGtGgjpLMSGuAT1tvqjLJYwcqI dOA4xyLgLWqkKb9Rx7MbLkdonb9cB21UaZNdNJbsNciPRAPtbm5XqjopII2WZjTs3Bsk6tppJQ/ 5XfyIOz4= X-Received: by 2002:ad4:5ba2:0:b0:56e:fbb8:a98e with SMTP id 2-20020ad45ba2000000b0056efbb8a98emr11946717qvq.22.1678714241178; Mon, 13 Mar 2023 06:30:41 -0700 (PDT) X-Google-Smtp-Source: AK7set+vdDNGD0Tl9NxwnX7kl0B7vKsVzngu4Mz0SzUokW96VhaTihqYAzFHW2IeIN04WsxgHC8lSw== X-Received: by 2002:ad4:5ba2:0:b0:56e:fbb8:a98e with SMTP id 2-20020ad45ba2000000b0056efbb8a98emr11946690qvq.22.1678714240918; Mon, 13 Mar 2023 06:30:40 -0700 (PDT) Received: from redhat.com (2603-7000-9500-34a5-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:34a5::1db4]) by smtp.gmail.com with ESMTPSA id x127-20020a376385000000b00745903986d8sm1462457qkb.114.2023.03.13.06.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 06:30:02 -0700 (PDT) Date: Mon, 13 Mar 2023 09:29:56 -0400 From: Marek Polacek To: Jonathan Wakely Cc: Basile Starynkevitch , Andrea Monaco , "gcc@gcc.gnu.org" Subject: Re: No warning about duplicate values in enum Message-ID: References: <7785d160-cd05-01e2-e800-4bc82d630c4e@starynkevitch.net> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.9 (2022-11-12) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Mar 11, 2023 at 04:48:14PM +0000, Jonathan Wakely via Gcc wrote: > On Sat, 11 Mar 2023, 12:53 Basile Starynkevitch, > 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. And as I said in the other thread about the very same issue, it's which is assigned to me and I hope to implement it for GC 14. Marek