From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Jason Wang" <jasowang@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Corey Minyard" <minyard@acm.org>
Subject: Re: [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it
Date: Sun, 15 Aug 2021 18:13:56 +0200 [thread overview]
Message-ID: <a751d952-8f9f-a861-2dad-0d5482a59c12@redhat.com> (raw)
In-Reply-To: <CAFEAcA-NP6ksSbd4sjREJh9sd0z-uP5rUJOcVNOYL=+VwE49cw@mail.gmail.com>
On 8/15/21 5:44 PM, Peter Maydell wrote:
> On Sun, 15 Aug 2021 at 15:34, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>>
>> On 8/13/21 8:30 PM, Eric Blake wrote:
>>> FWIW, the POSIX wording is interesting - it requires portable
>>> applications to zero out sockaddr_in6 (and even states that memset()
>>> is not yet a portable way to do that on exotic hardware, although a
>>> future version of POSIX may add a zero-bit constraint on
>>> implementations; in practice we only use qemu on hardware where
>>> memset() to zero properly sets pointers to NULL and floating points to
>>> 0.0).
>>
>> So this checkpatch.pl error (inherited from Linux) is against POSIX?
>>
>> 2028 # check for static initialisers.
>> 2029 if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) {
>> 2030 ERROR("do not initialise statics to 0 or NULL\n" .
>> 2031 $herecurr);
>> 2032 }
>
> That one is for statics, where the C spec says you get 0-init by
> default and so there's no need to explicitly 0-init.
Ah OK, thanks :)
next prev parent reply other threads:[~2021-08-15 16:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 15:05 [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it Peter Maydell
2021-08-13 15:05 ` [PATCH for-6.2 1/4] net: Zero sockaddr_in in parse_host_port() Peter Maydell
2021-08-13 18:34 ` Eric Blake
2021-08-13 15:05 ` [PATCH for-6.2 2/4] gdbstub: Zero-initialize sockaddr structs Peter Maydell
2021-08-13 18:37 ` Eric Blake
2021-08-13 15:05 ` [PATCH for-6.2 3/4] tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct Peter Maydell
2021-08-13 18:38 ` Eric Blake
2021-08-14 6:41 ` Thomas Huth
2021-08-14 15:46 ` Corey Minyard
2021-08-13 15:05 ` [PATCH for-6.2 4/4] tests/tcg/multiarch/linux-test: Zero-initialize sockaddr structs Peter Maydell
2021-08-13 18:39 ` Eric Blake
2021-08-13 18:30 ` [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it Eric Blake
2021-08-15 14:34 ` Philippe Mathieu-Daudé
2021-08-15 15:44 ` Peter Maydell
2021-08-15 16:13 ` Philippe Mathieu-Daudé [this message]
2021-08-26 14:34 ` Peter Maydell
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=a751d952-8f9f-a861-2dad-0d5482a59c12@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=eblake@redhat.com \
--cc=jasowang@redhat.com \
--cc=minyard@acm.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).