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=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 B78E226256 for ; Mon, 18 Mar 2024 23:23:09 +0100 (CET) Received: (qmail 1922 invoked by uid 550); 18 Mar 2024 22:18: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 1890 invoked from network); 18 Mar 2024 22:18:40 -0000 X-Virus-Scanned: SPAM Filter at disroot.org Date: Mon, 18 Mar 2024 22:22:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1710800575; bh=XPY3g5erRYAtwcNVi1Ntb+v3rC4A4S75NHFnpcYXO6o=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=MYYOePztdB6UapJOW4p1IbDKAU0akB3ukwSHhnD9pmt0tQrz6VCMCl35Ow5rmlVZ9 W3mBVfdtEJU9hGDZQToa7cNlpxxCXYcCM9fH2VPqRSFi2QDaXGzltve6MVvu7fnpyg ++CXsLFxlKeN9VP4o9j/S9U6dky4JlvisL+P8dy/VyyPvXlsVcK+ipfbQPtNRrsYed degmF943Bzj/SpZSJtUDwBl3V9OkdBicPQtwwwa2O3GcC6REi8XG7hgyADpNptdSnX al+8U5xTCDXa4p1wYtfZFSmg9PCdiPyx/I9lSTglQMfL+6CjLlOZENT47/0B+IkXth s3CAY5UeWipeQ== From: NRK To: musl@lists.openwall.com Cc: Mike Cui Message-ID: <627epdel4gidvu46u5ua2mclieqy3wwqbs7sxjgtgrsmkvn4up@ehu5ru6micnr> References: <20240318213441.GH4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240318213441.GH4163@brightrain.aerifal.cx> Subject: Re: [musl] Potential bug in __res_msend_rc() wrt to union initialization. On Mon, Mar 18, 2024 at 05:34:42PM -0400, Rich Felker wrote: > If the clang interpretation is going to be this, we can just reorder > the union members so that the largest one is first. Another option is to utilize implicit static initializer rules: | if it is a union, the first named member is initialized (recursively) | according to these rules, and any padding is initialized to zero bits; So something like: static union u zero; union u u = zero; Though, the "padding bits" part was added in C11 and wasn't present in C99 in case you want to be pedantic about C99 conformance. - NRK