All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/kdd: alternative way of muting spurious gcc warning
@ 2018-05-22 19:47 Marek Marczykowski-Górecki
  2018-05-23  4:02 ` Juergen Gross
  2018-05-23  7:48 ` Wei Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Marczykowski-Górecki @ 2018-05-22 19:47 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Wei Liu, Tim Deegan, Ian Jackson,
	Marek Marczykowski-Górecki, Jan Beulich

Older gcc does not support #pragma GCC diagnostics, so use alternative
approach - change variable type to uint32_t (this code handle 32-bit
requests only anyway), which apparently also avoid gcc complaining about
this (otherwise correct) code.

Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious
gcc warning"

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/debugger/kdd/kdd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c
index 61d769ece9..5a019a0a0c 100644
--- a/tools/debugger/kdd/kdd.c
+++ b/tools/debugger/kdd/kdd.c
@@ -687,7 +687,7 @@ static void kdd_handle_read_ctrl(kdd_state *s)
         }
     } else {
         /* 32-bit control-register space starts at 0x[2]cc, for 84 bytes */
-        uint64_t offset = addr;
+        uint32_t offset = addr;
         if (offset > 0x200)
             offset -= 0x200;
         offset -= 0xcc;
@@ -695,10 +695,7 @@ static void kdd_handle_read_ctrl(kdd_state *s)
             KDD_LOG(s, "Request outside of known control space\n");
             len = 0;
         } else {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warray-bounds"
             memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
-#pragma GCC diagnostic pop
         }
     }
 
-- 
2.13.6


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

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

* Re: [PATCH] tools/kdd: alternative way of muting spurious gcc warning
  2018-05-22 19:47 [PATCH] tools/kdd: alternative way of muting spurious gcc warning Marek Marczykowski-Górecki
@ 2018-05-23  4:02 ` Juergen Gross
  2018-05-25  6:26   ` Tim Deegan
  2018-05-23  7:48 ` Wei Liu
  1 sibling, 1 reply; 6+ messages in thread
From: Juergen Gross @ 2018-05-23  4:02 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki, xen-devel
  Cc: Ian Jackson, Tim Deegan, Wei Liu, Jan Beulich

On 22/05/18 21:47, Marek Marczykowski-Górecki wrote:
> Older gcc does not support #pragma GCC diagnostics, so use alternative
> approach - change variable type to uint32_t (this code handle 32-bit
> requests only anyway), which apparently also avoid gcc complaining about
> this (otherwise correct) code.
> 
> Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious
> gcc warning"
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

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

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

* Re: [PATCH] tools/kdd: alternative way of muting spurious gcc warning
  2018-05-22 19:47 [PATCH] tools/kdd: alternative way of muting spurious gcc warning Marek Marczykowski-Górecki
  2018-05-23  4:02 ` Juergen Gross
@ 2018-05-23  7:48 ` Wei Liu
  2018-05-23  8:28   ` Marek Marczykowski-Górecki
  1 sibling, 1 reply; 6+ messages in thread
From: Wei Liu @ 2018-05-23  7:48 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki
  Cc: Juergen Gross, Wei Liu, Tim Deegan, Ian Jackson, xen-devel, Jan Beulich

On Tue, May 22, 2018 at 09:47:45PM +0200, Marek Marczykowski-Górecki wrote:
> Older gcc does not support #pragma GCC diagnostics, so use alternative
> approach - change variable type to uint32_t (this code handle 32-bit
> requests only anyway), which apparently also avoid gcc complaining about
> this (otherwise correct) code.
> 
> Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious
> gcc warning"
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

I'm confused. Do we still need this? Gcc 8.1 seems to have fixed the bug
which caused compilation failure.

Wei.

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

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

* Re: [PATCH] tools/kdd: alternative way of muting spurious gcc warning
  2018-05-23  7:48 ` Wei Liu
@ 2018-05-23  8:28   ` Marek Marczykowski-Górecki
  2018-05-23  8:31     ` Wei Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Marczykowski-Górecki @ 2018-05-23  8:28 UTC (permalink / raw)
  To: Wei Liu; +Cc: Juergen Gross, Ian Jackson, Tim Deegan, Jan Beulich, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 986 bytes --]

On Wed, May 23, 2018 at 08:48:12AM +0100, Wei Liu wrote:
> On Tue, May 22, 2018 at 09:47:45PM +0200, Marek Marczykowski-Górecki wrote:
> > Older gcc does not support #pragma GCC diagnostics, so use alternative
> > approach - change variable type to uint32_t (this code handle 32-bit
> > requests only anyway), which apparently also avoid gcc complaining about
> > this (otherwise correct) code.
> > 
> > Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious
> > gcc warning"
> > 
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> 
> I'm confused. Do we still need this? Gcc 8.1 seems to have fixed the bug
> which caused compilation failure.

Apparently not entirely - see my other email. It still fails on Fedora
28 with gcc 8.1.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

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

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

* Re: [PATCH] tools/kdd: alternative way of muting spurious gcc warning
  2018-05-23  8:28   ` Marek Marczykowski-Górecki
@ 2018-05-23  8:31     ` Wei Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2018-05-23  8:31 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki
  Cc: Juergen Gross, Wei Liu, Ian Jackson, Tim Deegan, xen-devel, Jan Beulich

On Wed, May 23, 2018 at 10:28:47AM +0200, Marek Marczykowski-Górecki wrote:
> On Wed, May 23, 2018 at 08:48:12AM +0100, Wei Liu wrote:
> > On Tue, May 22, 2018 at 09:47:45PM +0200, Marek Marczykowski-Górecki wrote:
> > > Older gcc does not support #pragma GCC diagnostics, so use alternative
> > > approach - change variable type to uint32_t (this code handle 32-bit
> > > requests only anyway), which apparently also avoid gcc complaining about
> > > this (otherwise correct) code.
> > > 
> > > Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious
> > > gcc warning"
> > > 
> > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > 
> > I'm confused. Do we still need this? Gcc 8.1 seems to have fixed the bug
> > which caused compilation failure.
> 
> Apparently not entirely - see my other email. It still fails on Fedora
> 28 with gcc 8.1.
> 

Oh I missed that, sorry.

In that case we should take this patch instead:

Acked-by: Wei Liu <wei.liu2@citrix.com>

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

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

* Re: [PATCH] tools/kdd: alternative way of muting spurious gcc warning
  2018-05-23  4:02 ` Juergen Gross
@ 2018-05-25  6:26   ` Tim Deegan
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Deegan @ 2018-05-25  6:26 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Wei Liu, Ian Jackson, Marek Marczykowski-Górecki,
	Jan Beulich, xen-devel

At 06:02 +0200 on 23 May (1527055365), Juergen Gross wrote:
> On 22/05/18 21:47, Marek Marczykowski-Górecki wrote:
> > Older gcc does not support #pragma GCC diagnostics, so use alternative
> > approach - change variable type to uint32_t (this code handle 32-bit
> > requests only anyway), which apparently also avoid gcc complaining about
> > this (otherwise correct) code.
> > 
> > Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious
> > gcc warning"
> > 
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> 
> Release-acked-by: Juergen Gross <jgross@suse.com>

Acked-by: Tim Deegan <tim@xen.org>

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

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

end of thread, other threads:[~2018-05-25  6:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 19:47 [PATCH] tools/kdd: alternative way of muting spurious gcc warning Marek Marczykowski-Górecki
2018-05-23  4:02 ` Juergen Gross
2018-05-25  6:26   ` Tim Deegan
2018-05-23  7:48 ` Wei Liu
2018-05-23  8:28   ` Marek Marczykowski-Górecki
2018-05-23  8:31     ` Wei Liu

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.