[PATCH] [sim,rx] Silence warning that turns into a build error

Luis Machado luis.machado@linaro.org
Thu Apr 8 20:25:55 GMT 2021


On 4/8/21 5:23 PM, Luis Machado 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 = {};
>> -mike
>>
> 
> 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.

It may be the case that sim/ also builds with C++, like GDB. And {} 
would work for that then.


More information about the Gdb-patches mailing list