From: Luis Machado <luis.machado@linaro.org>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] [sim,rx] Silence warning that turns into a build error
Date: Fri, 9 Apr 2021 09:17:11 -0300 [thread overview]
Message-ID: <46c14f4d-e650-74b2-64a6-19c65816ab06@linaro.org> (raw)
In-Reply-To: <YG9uSk4NbHK96i8i@vapier>
On 4/8/21 5:57 PM, Mike Frysinger wrote:
> On 08 Apr 2021 17:23, Luis Machado via Gdb-patches wrote:
>> On 4/8/21 5:16 PM, Mike Frysinger wrote:
>>> On 08 Apr 2021 16:51, Luis Machado via Gdb-patches wrote:
>>>> + FP_Parts a = {0, 0, 0, 0, 0};
>>>
>>> wouldn't it be simpler & equiv:
>>> FP_Parts a = {};
>>
>> I find that it works, but I'm unsure if it is a standard way of doing it.
>>
>> The C reference says:
>>
>> "When initializing an object of struct or union type, the initializer
>> must be a non-empty, brace-enclosed, comma-separated list of
>> initializers for the members."
>>
>> So I went with the most obvious, as opposed to going shorter and more
>> opaque.
>
> my concern is more about having to tweak this whenever fields are added
> or removed.
>
> i couldn't remember if the ={} syntax was a C++ extension, or in C11.
> if it's a C++ extension, i *think* ={0} will work even in C11.
> -mike
>
I think it is a C++ thing. I pushed it with the {0} initializer now.
prev parent reply other threads:[~2021-04-09 12:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 19:51 Luis Machado
2021-04-08 20:16 ` Mike Frysinger
2021-04-08 20:23 ` Luis Machado
2021-04-08 20:25 ` Luis Machado
2021-04-08 20:57 ` Mike Frysinger
2021-04-09 12:17 ` Luis Machado [this message]
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=46c14f4d-e650-74b2-64a6-19c65816ab06@linaro.org \
--to=luis.machado@linaro.org \
--cc=gdb-patches@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).