Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: common: Fix pointer sign warnings
@ 2017-10-03 15:44 Stafford Horne
  2021-01-31 20:26 ` Mike Frysinger via Gdb-patches
  0 siblings, 1 reply; 4+ messages in thread
From: Stafford Horne @ 2017-10-03 15:44 UTC (permalink / raw)
  To: GDB patches; +Cc: Stafford Horne

When compiling we get the following warnings:

  common/cgen-accfp.c: In function ‘fixsfsi’:
  common/cgen-accfp.c:370:18: warning: pointer targets in passing argument 1 of ‘sim_fpu_to32i’ differ in signedness [-Wpointer-sign]
     sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
                  ^
  common/cgen-accfp.c: In function ‘fixdfsi’:
  common/cgen-accfp.c:381:18: warning: pointer targets in passing argument 1 of ‘sim_fpu_to32i’ differ in signedness [-Wpointer-sign]
     sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
                  ^
sim/common/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

	* cgen-accfp.c (fixsfsi): Change res from unsigned32 to signed32.
	(fixdfsi): Change res from unsigned32 to signed32.
---
 sim/common/cgen-accfp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c
index 5d600c6e41..ab3a477bbe 100644
--- a/sim/common/cgen-accfp.c
+++ b/sim/common/cgen-accfp.c
@@ -364,7 +364,7 @@ static SI
 fixsfsi (CGEN_FPU* fpu, int how UNUSED, SF x)
 {
   sim_fpu op1;
-  unsigned32 res;
+  signed32 res;
 
   sim_fpu_32to (&op1, x);
   sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
@@ -375,7 +375,7 @@ static SI
 fixdfsi (CGEN_FPU* fpu, int how UNUSED, DF x)
 {
   sim_fpu op1;
-  unsigned32 res;
+  signed32 res;
 
   sim_fpu_64to (&op1, x);
   sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
-- 
2.13.5


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

end of thread, other threads:[~2021-02-01  2:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-03 15:44 [PATCH] sim: common: Fix pointer sign warnings Stafford Horne
2021-01-31 20:26 ` Mike Frysinger via Gdb-patches
2021-02-01  1:31   ` Stafford Horne via Gdb-patches
2021-02-01  2:14     ` Mike Frysinger via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox