From: Andreas Schwab <schwab@linux-m68k.org>
To: John Crispin <john@phrozen.org>
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
Date: Sun, 20 Mar 2022 18:32:03 +0100 [thread overview]
Message-ID: <87a6dko7ho.fsf@igel.home> (raw)
In-Reply-To: <af6042d0-952f-f497-57e7-37fef45a1f76@phrozen.org> (John Crispin's message of "Sun, 20 Mar 2022 17:48:31 +0100")
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."
next prev parent reply other threads:[~2022-03-20 17:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-20 15:20 [PATCH] ath9k: initialize arrays at compile time trix
2022-03-20 16:16 ` Joe Perches
2022-03-20 16:48 ` John Crispin
2022-03-20 17:17 ` Sebastian Gottschall
2022-03-20 17:36 ` Joe Perches
2022-03-23 13:13 ` Tom Rix
2022-03-20 17:32 ` Andreas Schwab [this message]
2022-03-20 18:46 ` David Laight
2022-03-21 13:31 ` Toke Høiland-Jørgensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6dko7ho.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=davem@davemloft.net \
--cc=john@phrozen.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=toke@toke.dk \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).