[PATCH] correct format of flexible array members in diagnostics (PR c/92326)

Martin Liška mliska@suse.cz
Tue Apr 14 07:05:30 GMT 2020


On 4/13/20 9:41 PM, Martin Sebor wrote:
> On 4/13/20 1:25 PM, Jeff Law wrote:
>> On Mon, 2020-04-13 at 12:39 -0600, Martin Sebor via Gcc-patches wrote:
>>> GCC 10 has changed the formatting of zero-length arrays in diagnostics
>>> to include their bound, but it also inadvertently added the zero bound
>>> to flexible array members which are confusingly represented differently
>>> between the C and C++ front ends.
>>>
>>> The attached patch corrects the problem so both zero-length arrays and
>>> flexible array members are formatted consistently by both front ends
>>> (i.e., as T[0] and T[]).
>>>
>>> Tested on x86_64-linux.
>> This is fine.
>>
>> Though I don't see that it actually addressed the qemu or grub2 issues raised by
>> Martin L.  ISTM those really should be a separate bug independent of the wrong-
>> bound in the diagnostic.  It looks like Martin L's claim is that for qemu & grub2
>> we've got new false positives from the warning.  Thoughts?
> 
> I don't see how this could cause false positives, unless something
> is set up to filter out the specific text of the warning and this
> change makes the filtering fail.
> 
> I had asked Martin (CC'd) about it but didn't understand his answer
> in c#5 on the bug.  Martin?

Hi.

Official SUSE guideline recommends not to use -Werror for package builds. However, there
are package like grub or qemu that use -Werror. That's why these packages hit the error
in a way that I noticed. Both these packages decided to fix the warnings.

Martin

> 
> M.



More information about the Gcc-patches mailing list