From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 2B2D01F47C for ; Sun, 15 Jan 2023 01:59:29 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=78364E5A-2AF3-11ED-87FA-8298ECA2D365 header.b=iMKmFLug; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGsIq-0005LZ-SP; Sat, 14 Jan 2023 20:59:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGsIn-0005L7-UQ for bug-gnulib@gnu.org; Sat, 14 Jan 2023 20:59:18 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGsIm-0007E3-89 for bug-gnulib@gnu.org; Sat, 14 Jan 2023 20:59:17 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6F812160040; Sat, 14 Jan 2023 17:59:14 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id wfus1gbjyKC5; Sat, 14 Jan 2023 17:59:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5FA74160041; Sat, 14 Jan 2023 17:59:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 5FA74160041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1673747953; bh=8C4JV2WoYzJ0lT2AvDyMIYwBXacqJIaXJJB3xd7Co98=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type: Content-Transfer-Encoding; b=iMKmFLugY8MtYmAaaDFdo74WzAg4kokEjxS4jF8YnhjTt1eOmBAJYto8jW5qVY9Bb b8MPdLf5Xe+QVRR+R8IoNM6JS6zMLbi3K3g+DwlGEHLcMXobAD5qrfyo/YU/7fnE2B WzBIr3d8VAxBd1S53XLBJ4BYwJ98OfZ7VxSHnZhQ= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Soy6rZ2TNiaN; Sat, 14 Jan 2023 17:59:12 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8F81E160040; Sat, 14 Jan 2023 17:59:12 -0800 (PST) Message-ID: Date: Sat, 14 Jan 2023 17:59:12 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 To: Bruno Haible , bug-gnulib@gnu.org, Khem Raj References: <20230114232744.215167-1-raj.khem@gmail.com> <4385269.dumfJixkPq@nimes> Content-Language: en-US From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: [PATCH] Define alignof_slot using _Alignof when using C11 or newer In-Reply-To: <4385269.dumfJixkPq@nimes> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org On 2023-01-14 16:17, Bruno Haible wrote: > What's (quasi) normative is > > * n3047.pdf = C23, which says in 7.21.(3) > "If the specified type defines a new type or if the specified member is > a bit-field, the behavior is undefined." I'm afraid this wording in n3047 is unclear. Ordinarily one would look at n3047's section "Type definitions" to interpret the phrase "defines a new type", but as that section merely talks about typedefs it doesn't seem to be relevant here. I can't find any part of the standard that talks about "defining a new type". All the standardizers wanted here is for the TYPE to not contain a top-level comma in 'offsetof (TYPE, MEMBER)' because that would screw up macro argument identification. I hope Clang 16 is not reporting an error for 'offsetof (struct {char a; int b;}, b)'; if so, it's gone off the deep end. A nameless struct does not "define a new type" for some reasonable definitions of the term "define a new type", and since the standard doesn't define that term the Clang developers should be cautious about diagnostics in this messy area when a lot of code out there uses offsetof in precisely this way.