xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] x86/cpuid: Fix build with CentOS 6 following c/s 7479151106
@ 2019-09-09 15:55 Andrew Cooper
  2019-09-10  6:38 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2019-09-09 15:55 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Roger Pau Monné

GCC of a CentOS 6 vintage complains:

  cpuid.c: In function 'parse_xen_cpuid':
  cpuid.c:32: error: 'mid' may be used uninitialized in this function

This can't occur in practice because the while() loop is guarenteed to be
entered, but initialise mid to work around the issues.

Spotted by Gitlab CI.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 36b1e2ce4c..acba0f7583 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -29,7 +29,7 @@ static int __init parse_xen_cpuid(const char *s)
             const char *name;
             unsigned int bit;
         } features[] __initconstrel = INIT_FEATURE_NAMES;
-        const struct feature *lhs, *mid, *rhs;
+        const struct feature *lhs, *rhs, *mid = NULL /* GCC... */;
         const char *feat;
 
         ss = strchr(s, ',');
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH] x86/cpuid: Fix build with CentOS 6 following c/s 7479151106
  2019-09-09 15:55 [Xen-devel] [PATCH] x86/cpuid: Fix build with CentOS 6 following c/s 7479151106 Andrew Cooper
@ 2019-09-10  6:38 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2019-09-10  6:38 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel, Wei Liu, Roger Pau Monné

On 09.09.2019 17:55, Andrew Cooper wrote:
> GCC of a CentOS 6 vintage complains:
> 
>   cpuid.c: In function 'parse_xen_cpuid':
>   cpuid.c:32: error: 'mid' may be used uninitialized in this function
> 
> This can't occur in practice because the while() loop is guarenteed to be
> entered, but initialise mid to work around the issues.
> 
> Spotted by Gitlab CI.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Ah, yes, thanks. I too had noticed this yesterday, but didn't get
around to check what the correct workaround would be.

Acked-by: Jan Beulich <jbeulich@suse.com>

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-09-10  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 15:55 [Xen-devel] [PATCH] x86/cpuid: Fix build with CentOS 6 following c/s 7479151106 Andrew Cooper
2019-09-10  6:38 ` Jan Beulich

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