qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] util/cacheinfo: Fix warning generated by clang
@ 2017-06-30 15:39 Pranith Kumar
  2017-06-30 21:15 ` Emilio G. Cota
  2017-07-01 22:20 ` Richard Henderson
  0 siblings, 2 replies; 7+ messages in thread
From: Pranith Kumar @ 2017-06-30 15:39 UTC (permalink / raw)
  To: Richard Henderson, Emilio G. Cota, open list:All patches CC here

Clang generates the following warning on aarch64 host:

  CC      util/cacheinfo.o
/home/pranith/qemu/util/cacheinfo.c:121:48: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
        asm volatile("mrs\t%0, ctr_el0" : "=r"(ctr));
                                               ^
/home/pranith/qemu/util/cacheinfo.c:121:28: note: use constraint modifier "w"
        asm volatile("mrs\t%0, ctr_el0" : "=r"(ctr));
                           ^~
                           %w0

Constraint modifier 'w' is not (yet?) accepted by gcc. Fix this by increasing the ctr size.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 util/cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/cacheinfo.c b/util/cacheinfo.c
index f987522df4..6253049533 100644
--- a/util/cacheinfo.c
+++ b/util/cacheinfo.c
@@ -112,7 +112,7 @@ static void sys_cache_info(int *isize, int *dsize)
 static void arch_cache_info(int *isize, int *dsize)
 {
     if (*isize == 0 || *dsize == 0) {
-        unsigned ctr;
+        unsigned long ctr;
 
         /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1,
            but (at least under Linux) these are marked protected by the
-- 
2.13.0

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

end of thread, other threads:[~2017-07-03 21:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30 15:39 [Qemu-devel] [PATCH] util/cacheinfo: Fix warning generated by clang Pranith Kumar
2017-06-30 21:15 ` Emilio G. Cota
2017-07-01 22:20 ` Richard Henderson
2017-07-01 22:30   ` Peter Maydell
2017-07-01 22:35     ` Richard Henderson
2017-07-01 22:44       ` Peter Maydell
2017-07-03 21:16         ` Richard Henderson

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