All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Buono <dbuono@linux.vnet.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>
Cc: "Alexander Bulekov" <alxndr@bu.edu>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Janosch Frank" <frankja@linux.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings
Date: Tue, 27 Oct 2020 12:17:35 -0400	[thread overview]
Message-ID: <78237c80-3ac7-d567-1c54-17d74b4381fb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20201027123846.18dd5c91.cohuck@redhat.com>

So what I would do for the warning in IplParameterBlock is the following
(if I got the comments right):

- Remove IplBlockFcp from IplParameterBlock
- Keep IPLBlockPV and, in its declaration, use
struct IPLBlockPVComp components[0];

Now for the IplBlockFcp struct declaration, it does not seem to be used
anywhere now.
I could either keep it as it was before (with the variable-size array)
or remove it entirely.
I guess this is more a question for the maintainers, what is your
preference here?

Daniele

On 10/27/2020 7:38 AM, Cornelia Huck wrote:
> On Tue, 27 Oct 2020 12:26:21 +0100
> Thomas Huth <thuth@redhat.com> wrote:
> 
>> On 26/10/2020 16.12, Paolo Bonzini wrote:
>>> On 26/10/20 16:03, Daniele Buono wrote:
>>>> Hi Paolo,
>>>> I reorganized UASStatus to put uas_iu at the end and it works fine.
>>>> Unfortunately, this uncovered another part of the code with a similar
>>>> issue (variable sized type not at the end of the struct), here:
>>>>
>>>> In file included from ../qemu-cfi-v3/target/s390x/diag.c:21:
>>>> ../qemu-cfi-v3/hw/s390x/ipl.h:161:23: error: field 'iplb' with variable
>>>> sized type 'IplParameterBlock' (aka 'union IplParameterBlock') not at
>>>> the end of a struct or class is a GNU extension
>>>> [-Werror,-Wgnu-variable-sized-type-not-at-end]
>>>>      IplParameterBlock iplb;
>>>>                        ^
>>>> ../qemu-cfi-v3/hw/s390x/ipl.h:162:23: error: field 'iplb_pv' with
>>>> variable sized type 'IplParameterBlock' (aka 'union IplParameterBlock')
>>>> not at the end of a struct or class is a GNU extension
>>>> [-Werror,-Wgnu-variable-sized-type-not-at-end]
>>>>      IplParameterBlock iplb_pv;
>>>>
>>>> My understanding is that each of these IplParameterBlock may contain
>>>> either a IPLBlockPV or a IplBlockFcp, which both end with a variable
>>>> sized field (an array).
>>>>
>>>> Adding maintainers of s390x to see if they have a suggested solution to
>>>> avoid disabling the warning.
>>>
>>> This one seems okay because the union constrains the size to 4K. If
>>> "[0]" is enough to shut up the compiler, I'd say do that.
>>
>> The "IplBlockFcp fcp" part seems to be completely unused, so I think you
>> could even remove that IplBlockFcp struct. For IPLBlockPV I agree with
>> Paolo, it's likely easiest to use [0] for that struct.
> 
> The fcp block had probably been added for completeness' sake, but we do
> not support list-directed IPL anyway. Not sure if we actually want it,
> as we use a different mechanism for IPLing from SCSI devices. So yes,
> maybe we should just drop it.
> 
> 


  reply	other threads:[~2020-10-27 16:18 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 20:06 [PATCH v2 0/6] Add support for Control-Flow Integrity Daniele Buono
2020-10-23 20:06 ` [PATCH v2 1/6] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD Daniele Buono
2020-10-23 20:06 ` [PATCH v2 2/6] configure: avoid new clang 11+ warnings Daniele Buono
2020-10-24  5:17   ` Thomas Huth
2020-10-24 12:42     ` Daniele Buono
2020-10-26  9:50   ` Paolo Bonzini
2020-10-26 15:03     ` Daniele Buono
2020-10-26 15:12       ` Paolo Bonzini
2020-10-26 21:40         ` Daniele Buono
2020-10-26 22:08         ` Peter Maydell
2020-10-27 11:26         ` Thomas Huth
2020-10-27 11:38           ` Cornelia Huck
2020-10-27 16:17             ` Daniele Buono [this message]
2020-10-23 20:06 ` [PATCH v2 3/6] configure: add option to enable LTO Daniele Buono
2020-10-26  9:51   ` Paolo Bonzini
2020-10-26 15:50     ` Daniel P. Berrangé
2020-10-27 14:57       ` Daniele Buono
2020-10-27 15:17         ` Daniel P. Berrangé
2020-10-27 20:42           ` Daniele Buono
2020-10-28  6:44             ` Paolo Bonzini
2020-10-28 18:22               ` Daniele Buono
2020-10-29 10:19                 ` Paolo Bonzini
2020-10-28  9:35         ` Alex Bennée
2020-10-28 18:47           ` Daniele Buono
2020-10-23 20:06 ` [PATCH v2 4/6] cfi: Initial support for cfi-icall in QEMU Daniele Buono
2020-10-26  9:52   ` Paolo Bonzini
2020-10-27 10:11   ` Alex Bennée
2020-10-23 20:06 ` [PATCH v2 5/6] check-block: enable iotests with cfi-icall Daniele Buono
2020-10-23 20:06 ` [PATCH v2 6/6] configure: add support for Control-Flow Integrity Daniele Buono
2020-10-26 10:00   ` Paolo Bonzini
2020-10-23 20:33 ` [PATCH v2 0/6] Add " Eric Blake
2020-10-24 11:58   ` Daniele Buono
2020-10-26  9:26   ` Daniel P. Berrangé

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=78237c80-3ac7-d567-1c54-17d74b4381fb@linux.vnet.ibm.com \
    --to=dbuono@linux.vnet.ibm.com \
    --cc=alxndr@bu.edu \
    --cc=berrange@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.