qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations
@ 2020-08-18 10:50 Rohit Shinde
  2020-08-25  6:03 ` Markus Armbruster
  0 siblings, 1 reply; 6+ messages in thread
From: Rohit Shinde @ 2020-08-18 10:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Rohit Shinde, armbru, mdroth

Added fallthrough comment on line 270 to prevent the compiler from
throwing an error while compiling with the -Wimplicit-fallthrough flag

Signed-off-by: Rohit Shinde <rohit.shinde12194@gmail.com>
---
 qapi/opts-visitor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 7781c23a42..3422ff265e 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -266,6 +266,7 @@ opts_next_list(Visitor *v, GenericList *tail, size_t size)
         }
         ov->list_mode = LM_IN_PROGRESS;
         /* range has been completed, fall through in order to pop option */
+        /* fallthrough */
 
     case LM_IN_PROGRESS: {
         const QemuOpt *opt;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations
  2020-08-18 10:50 [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations Rohit Shinde
@ 2020-08-25  6:03 ` Markus Armbruster
  2020-08-27  0:55   ` Rohit Shinde
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Armbruster @ 2020-08-25  6:03 UTC (permalink / raw)
  To: Rohit Shinde; +Cc: qemu-trivial, qemu-devel, mdroth

Rohit Shinde <rohit.shinde12194@gmail.com> writes:

> Added fallthrough comment on line 270 to prevent the compiler from
> throwing an error while compiling with the -Wimplicit-fallthrough flag

None of the compilers I know warns there.  Which one are you using?

Commit message style tip: use the imperative mood
https://chris.beams.io/posts/git-commit/#imperative

> Signed-off-by: Rohit Shinde <rohit.shinde12194@gmail.com>
> ---
>  qapi/opts-visitor.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
> index 7781c23a42..3422ff265e 100644
> --- a/qapi/opts-visitor.c
> +++ b/qapi/opts-visitor.c
> @@ -266,6 +266,7 @@ opts_next_list(Visitor *v, GenericList *tail, size_t size)
>          }
>          ov->list_mode = LM_IN_PROGRESS;
>          /* range has been completed, fall through in order to pop option */
> +        /* fallthrough */
>  
>      case LM_IN_PROGRESS: {
>          const QemuOpt *opt;



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations
  2020-08-25  6:03 ` Markus Armbruster
@ 2020-08-27  0:55   ` Rohit Shinde
  2020-08-27  6:10     ` Markus Armbruster
  0 siblings, 1 reply; 6+ messages in thread
From: Rohit Shinde @ 2020-08-27  0:55 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-trivial, qemu-devel, mdroth

[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]

I am just compiling with cflag set to -Wimplicit-fallthrough. I am using
gcc.

On Tue, Aug 25, 2020 at 2:03 AM Markus Armbruster <armbru@redhat.com> wrote:

> Rohit Shinde <rohit.shinde12194@gmail.com> writes:
>
> > Added fallthrough comment on line 270 to prevent the compiler from
> > throwing an error while compiling with the -Wimplicit-fallthrough flag
>
> None of the compilers I know warns there.  Which one are you using?
>
> Commit message style tip: use the imperative mood
> https://chris.beams.io/posts/git-commit/#imperative
>
> > Signed-off-by: Rohit Shinde <rohit.shinde12194@gmail.com>
> > ---
> >  qapi/opts-visitor.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
> > index 7781c23a42..3422ff265e 100644
> > --- a/qapi/opts-visitor.c
> > +++ b/qapi/opts-visitor.c
> > @@ -266,6 +266,7 @@ opts_next_list(Visitor *v, GenericList *tail, size_t
> size)
> >          }
> >          ov->list_mode = LM_IN_PROGRESS;
> >          /* range has been completed, fall through in order to pop
> option */
> > +        /* fallthrough */
> >
> >      case LM_IN_PROGRESS: {
> >          const QemuOpt *opt;
>
>

[-- Attachment #2: Type: text/html, Size: 1866 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations
  2020-08-27  0:55   ` Rohit Shinde
@ 2020-08-27  6:10     ` Markus Armbruster
  2020-08-28  0:07       ` Rohit Shinde
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Armbruster @ 2020-08-27  6:10 UTC (permalink / raw)
  To: Rohit Shinde; +Cc: qemu-trivial, qemu-devel, mdroth

Rohit Shinde <rohit.shinde12194@gmail.com> writes:

> I am just compiling with cflag set to -Wimplicit-fallthrough. I am using
> gcc.

-Wimplicit-fallthrough is the same as -Wimplicit-fallthrough=3.  Our
-code is not prepared for that.  What should work is
--Wimplicit-fallthrough=2.

If you have patches to make the entire tree compile with
-Wimplicit-fallthrough=3, we can talk.  You'd have to test them on all
supported hosts, and with a sufficient range of configurations to ensure
they are not breaking builds.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations
  2020-08-27  6:10     ` Markus Armbruster
@ 2020-08-28  0:07       ` Rohit Shinde
  2020-08-28  6:08         ` Markus Armbruster
  0 siblings, 1 reply; 6+ messages in thread
From: Rohit Shinde @ 2020-08-28  0:07 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-trivial, qemu-devel, mdroth

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]

Hey Markus,

Thanks for the clarification! No, I do not have patches for the same. I was
browsing through the bite sized tasks page and that did not mention these
details. I will keep this in mind however. For now, I will leave this task
and I might return to it at a later time.

Thanks,
Rohit.

On Wed, Aug 26, 2020 at 11:10 PM Markus Armbruster <armbru@redhat.com>
wrote:

> Rohit Shinde <rohit.shinde12194@gmail.com> writes:
>
> > I am just compiling with cflag set to -Wimplicit-fallthrough. I am using
> > gcc.
>
> -Wimplicit-fallthrough is the same as -Wimplicit-fallthrough=3.  Our
> -code is not prepared for that.  What should work is
> --Wimplicit-fallthrough=2.
>
> If you have patches to make the entire tree compile with
> -Wimplicit-fallthrough=3, we can talk.  You'd have to test them on all
> supported hosts, and with a sufficient range of configurations to ensure
> they are not breaking builds.
>
>

[-- Attachment #2: Type: text/html, Size: 1382 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations
  2020-08-28  0:07       ` Rohit Shinde
@ 2020-08-28  6:08         ` Markus Armbruster
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Armbruster @ 2020-08-28  6:08 UTC (permalink / raw)
  To: Rohit Shinde; +Cc: qemu-trivial, qemu-devel, mdroth

Rohit Shinde <rohit.shinde12194@gmail.com> writes:

> Hey Markus,
>
> Thanks for the clarification! No, I do not have patches for the same. I was
> browsing through the bite sized tasks page and that did not mention these
> details. I will keep this in mind however. For now, I will leave this task
> and I might return to it at a later time.

I corrected https://wiki.qemu.org/Contribute/BiteSizedTasks to ask for
-Wimplicit-fallthrough=2.  Thanks!



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-28  6:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-18 10:50 [PATCH v5] qapi/opts-visitor: Added missing fallthrough annotations Rohit Shinde
2020-08-25  6:03 ` Markus Armbruster
2020-08-27  0:55   ` Rohit Shinde
2020-08-27  6:10     ` Markus Armbruster
2020-08-28  0:07       ` Rohit Shinde
2020-08-28  6:08         ` Markus Armbruster

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).