From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 3CBDA2D71D for ; Tue, 19 Mar 2024 19:02:11 +0100 (CET) Received: (qmail 27664 invoked by uid 550); 19 Mar 2024 17:57:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 24093 invoked from network); 19 Mar 2024 16:28:39 -0000 X-Env-Mailfrom: aaron_ng@inode.at X-Env-Rcptto: musl@lists.openwall.com X-SourceIP: 85.127.183.170 X-CNFS-Analysis: v=2.4 cv=Jv5Sr94C c=1 sm=1 tr=0 ts=65f9be39 a=EGcOpCTuptRmag7BTP1Y/Q==:117 a=EGcOpCTuptRmag7BTP1Y/Q==:17 a=IkcTkHD0fZMA:10 a=h4kuuwGPobh8buW160wA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: aaron_ng@inode.at DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=inode.at; s=201801custpemceu; t=1710865977; bh=nYkYF6L9diOMuBEtFIGqGQtuwDgFcdFTNDMQvyixIHo=; h=Date:From:To:Subject; b=UCOTM4b1kLEBBelENCDiPxJ58PH37atHT8RwRPFUmvbY8m5RJqu7Joe4iqWSg/aMU TmBFMNYPGOC3qP8DnNVDH0jHqvLTalxiXOO7dbigxOaU3iMTB8LLIoeLmL36qLWmw1 gABdux7zzSJg83JxSWIXaR/MlityUQSP9SFZlI28pGb02sIlTeX0ZvoA+r5DwSD4Bp HoMjjiRZY3/wReol5ZxwMaolUkUQivnKpWmdoysa3f+4uo8iPfLarz5BIWCKSMFbQ0 V1XVwfzt1FalvWO8BdrRvcXywFrXTPP+Q3BQEl9Wymd8zdMLS0ErLnzrsJ710Bhxcm sC8+ZDiczCd4Q== Message-ID: Date: Tue, 19 Mar 2024 17:32:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US, de-DE From: Aaron Peter Bachmann To: musl@lists.openwall.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfLBu+06ILTZcvjsvLLMDP/znk9XC0wNziTcM5r0WA/csKEcWgY4crZf/k2j9e8r0QhrvcFEO/e/duDgJlU4lnkBh2e+FVWpmId6gseDlUmnsM3rOffNE 3j/Zn/Cwuq562PbZm0lIMa895XrdtyjOCYTgbsodlj1rNa6vIpCRwX4eW2gs0W18lVCg5DSIfvvFaYXLJRYqA7QyVHkRlhgXe3w= Subject: [musl] Re: Re: Potential bug in __res_msend_rc() wrt to union On Tue, 19 Mar 2024 09:18:33 -0400 Rich Felker wrote: >C11 adds (in 6.7.9 ΒΆ10): > > "if it is a union, the first named member is initialized > (recursively) according to these rules, and any padding is > initialized to zero bits;" > >where C99 just had (6.7.8): > > "if it is a union, the first named member is initialized > (recursively) according to these rules." > >So I think C11 and later actually require the full zero >initialization of all bits, and clang is just wrong. "all bits" is a bit misleading, as it does not cover padding (alignment holes and anonymous bit-fileds and holes due to bit-fields). At least that is what I think the standard says. The compiler is likely to implement "all bits". C23 ... = { } - without 0 between the braces - really includes "all bits" but even recent C++ does not. Regards, Aaron Peter Bachmann