xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 1/7] xen/arm: Make make_cpus_node() compile at -Og
Date: Thu, 22 Apr 2021 19:20:36 +0100	[thread overview]
Message-ID: <713d50cc-1036-03eb-f9e4-a330abafb3d4@xen.org> (raw)
In-Reply-To: <20210419140132.16909-2-andrew.cooper3@citrix.com>

Hi Andrew,

On 19/04/2021 15:01, Andrew Cooper wrote:
> When compiling at -Og:
> 
>    domain_build.c: In function 'make_cpus_node':
>    domain_build.c:926:12: error: 'clock_valid' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      926 |         if ( clock_valid )
>          |            ^
> 
> The compiler hasn't spotted that clock_valid is always initialised after the
> "if ( !compatible )" check.  Initialise clock_valid to false.

Can you confirm which version this is affecting? We bumped the minimum 
version of GCC recently, so I want to make sure we don't add code to 
silence older compilers.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> ---
>   xen/arch/arm/domain_build.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index b1d7b9849f..b10f5c8f85 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -831,7 +831,7 @@ static int __init make_cpus_node(const struct domain *d, void *fdt)
>       /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
>       char buf[13];
>       u32 clock_frequency;
> -    bool clock_valid;
> +    bool clock_valid = false;

Would you mind to add something like:

/* Initialized silence at least GCC X.Y. */

With X.Y replaced with the version.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2021-04-22 18:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 14:01 [PATCH 0/7] xen: Switch to using -Og for debug builds Andrew Cooper
2021-04-19 14:01 ` [PATCH 1/7] xen/arm: Make make_cpus_node() compile at -Og Andrew Cooper
2021-04-22 18:20   ` Julien Grall [this message]
2021-04-19 14:01 ` [PATCH 2/7] x86/shim: Fix compilation " Andrew Cooper
2021-04-19 14:01 ` [PATCH 3/7] x86/sysctl: Make arch_do_sysctl() compile " Andrew Cooper
2021-04-19 14:01 ` [PATCH 4/7] x86/irq: Make create_irq() " Andrew Cooper
2021-04-19 14:01 ` [PATCH 5/7] xen/efi: Make efi_start() " Andrew Cooper
2021-04-19 14:01 ` [PATCH 6/7] x86/shadow: Make _shadow_prealloc() " Andrew Cooper
2021-04-22  7:52   ` Tim Deegan
2021-04-19 14:01 ` [PATCH 7/7] xen: Use -Og for debug builds when available Andrew Cooper
2021-04-19 15:45 ` [PATCH 0/7] xen: Switch to using -Og for debug builds Jan Beulich
2021-04-21  9:31   ` Andrew Cooper
2021-04-21  9:51     ` Jan Beulich

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=713d50cc-1036-03eb-f9e4-a330abafb3d4@xen.org \
    --to=julien@xen.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [PATCH 1/7] xen/arm: Make make_cpus_node() compile at -Og' \
    /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

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