All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Stefan Weil <sw@weilnetz.de>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Michael Rolnik <mrolnik@gmail.com>,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH] target/avr: Fix compiler errors (-Werror=enum-conversion)
Date: Thu, 16 Sep 2021 12:11:37 +0200	[thread overview]
Message-ID: <60a4fa8a-490c-e82e-696b-35e563817e39@vivier.eu> (raw)
In-Reply-To: <20210706180936.249912-1-sw@weilnetz.de>

Le 06/07/2021 à 20:09, Stefan Weil a écrit :
> ../target/avr/translate.c: In function ‘gen_jmp_ez’:
> ../target/avr/translate.c:1012:22: error: implicit conversion from ‘enum <anonymous>’ to ‘DisasJumpType’ [-Werror=enum-conversion]
>  1012 |     ctx->base.is_jmp = DISAS_LOOKUP;
>       |                      ^
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> 
> -Werror=enum-conversion is not enabled by -Wall, but by -Weverything
> with clang for example.
> 
> As other targets use similar define statements, I think that's a simple fix.
> 
> Regards,
> Stefan
> 
> 
>  target/avr/translate.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/target/avr/translate.c b/target/avr/translate.c
> index c06ce45bc7..fcc839ac36 100644
> --- a/target/avr/translate.c
> +++ b/target/avr/translate.c
> @@ -70,11 +70,9 @@ static const char reg_names[NUMBER_OF_CPU_REGISTERS][8] = {
>  };
>  #define REG(x) (cpu_r[x])
>  
> -enum {
> -    DISAS_EXIT   = DISAS_TARGET_0,  /* We want return to the cpu main loop.  */
> -    DISAS_LOOKUP = DISAS_TARGET_1,  /* We have a variable condition exit.  */
> -    DISAS_CHAIN  = DISAS_TARGET_2,  /* We have a single condition exit.  */
> -};
> +#define DISAS_EXIT   DISAS_TARGET_0  /* We want return to the cpu main loop.  */
> +#define DISAS_LOOKUP DISAS_TARGET_1  /* We have a variable condition exit.  */
> +#define DISAS_CHAIN  DISAS_TARGET_2  /* We have a single condition exit.  */
>  
>  typedef struct DisasContext DisasContext;
>  
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


      parent reply	other threads:[~2021-09-16 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 18:09 [PATCH] target/avr: Fix compiler errors (-Werror=enum-conversion) Stefan Weil
2021-07-06 19:52 ` Michael Rolnik
2021-09-16 10:11 ` Laurent Vivier [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=60a4fa8a-490c-e82e-696b-35e563817e39@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=mrolnik@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sw@weilnetz.de \
    /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.