From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00E2CC433EF for ; Sun, 20 Mar 2022 17:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245741AbiCTRl7 (ORCPT ); Sun, 20 Mar 2022 13:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbiCTRl6 (ORCPT ); Sun, 20 Mar 2022 13:41:58 -0400 X-Greylist: delayed 506 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 20 Mar 2022 10:40:35 PDT Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B879192373; Sun, 20 Mar 2022 10:40:34 -0700 (PDT) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4KM4Yx48lbz1qy4d; Sun, 20 Mar 2022 18:32:05 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4KM4Yw6JJxz1qqkC; Sun, 20 Mar 2022 18:32:04 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id AZNAXHq-zqdT; Sun, 20 Mar 2022 18:32:03 +0100 (CET) X-Auth-Info: PRG5CVsyc2awA5undKWlsYbTr46vvzvy3CjZzJKLMMmL+/aS5lMla6dWJ55goAm+ Received: from igel.home (ppp-46-244-164-143.dynamic.mnet-online.de [46.244.164.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 20 Mar 2022 18:32:03 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 68B1B2C3A4A; Sun, 20 Mar 2022 18:32:03 +0100 (CET) From: Andreas Schwab To: John Crispin Cc: trix@redhat.com, toke@toke.dk, kvalo@kernel.org, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ath9k: initialize arrays at compile time References: <20220320152028.2263518-1-trix@redhat.com> X-Yow: I'm using my X-RAY VISION to obtain a rare glimpse of the INNER WORKINGS of this POTATO!! Date: Sun, 20 Mar 2022 18:32:03 +0100 In-Reply-To: (John Crispin's message of "Sun, 20 Mar 2022 17:48:31 +0100") Message-ID: <87a6dko7ho.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mär 20 2022, John Crispin wrote: > If I recall correctly { 0 } will only set the first element of the > struct/array to 0 and leave random data in all others elements An initializer always initializes the _whole_ object. The subject is also wrong, all initializers are executed at run time (automatic variables cannot be initialized at compile time). -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."