Fix microblaze sim build error

Message ID dce45abf-e44f-cc7f-f59c-4ade0bc6fb88@suse.cz
State New
Headers show
Series
  • Fix microblaze sim build error
Related show

Commit Message

Martin Liška April 1, 2021, 5:18 a.m.
I see the following error for --target=microblaze-elf:

../../../sim/microblaze/interp.c: In function ‘sim_engine_run’:
../../../sim/microblaze/interp.c:147:39: error: passing argument 2 of ‘get_insn_microblaze’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  147 |       op = get_insn_microblaze (inst, &imm_unsigned, &insn_type,
      |                                       ^~~~~~~~~~~~~
      |                                       |
      |                                       int *
In file included from ../../bfd/bfd.h:45,
                 from ../../../sim/microblaze/interp.c:24:
../../../sim/microblaze/../../opcodes/microblaze-dis.h:34:57: note: expected ‘_Bool *’ but argument is of type ‘int *’
   34 | extern enum microblaze_instr get_insn_microblaze (long, bool *,
      |                                                         ^

sim/microblaze/ChangeLog:

	* interp.c (sim_engine_run): Use bool instead of int.
---
 sim/microblaze/interp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.30.2

Comments

H.J. Lu via Binutils April 1, 2021, 1:49 p.m. | #1
thanks, lgtm.  i was just going to make the same change :x.
-mike
Martin Liška April 1, 2021, 1:53 p.m. | #2
On 4/1/21 3:49 PM, Mike Frysinger wrote:
> thanks, lgtm.  i was just going to make the same change :x.

> -mike

> 


Thanks, I've just pushed the commit.

Cheers,
Martin
Michael Eager April 2, 2021, 11:18 a.m. | #3
On 3/31/21 10:18 PM, Martin Liška wrote:
> I see the following error for --target=microblaze-elf:

> 

> ../../../sim/microblaze/interp.c: In function ‘sim_engine_run’:

> ../../../sim/microblaze/interp.c:147:39: error: passing argument 2 of ‘get_insn_microblaze’ from incompatible pointer type [-Werror=incompatible-pointer-types]

>    147 |       op = get_insn_microblaze (inst, &imm_unsigned, &insn_type,

>        |                                       ^~~~~~~~~~~~~

>        |                                       |

>        |                                       int *

> In file included from ../../bfd/bfd.h:45,

>                   from ../../../sim/microblaze/interp.c:24:

> ../../../sim/microblaze/../../opcodes/microblaze-dis.h:34:57: note: expected ‘_Bool *’ but argument is of type ‘int *’

>     34 | extern enum microblaze_instr get_insn_microblaze (long, bool *,

>        |                                                         ^

> 

> sim/microblaze/ChangeLog:

> 

> 	* interp.c (sim_engine_run): Use bool instead of int.

> ---

>   sim/microblaze/interp.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c

> index 5b125a64da2..8a9dbc3245a 100644

> --- a/sim/microblaze/interp.c

> +++ b/sim/microblaze/interp.c

> @@ -126,7 +126,7 @@ sim_engine_run (SIM_DESC sd,

>     int cycs;

>     word WLhash;

>     ubyte carry;

> -  int imm_unsigned;

> +  bool imm_unsigned;

>     short ra, rb, rd;

>     long immword;

>     uword oldpc, newpc;

> 


OK to apply.

-- 
Michael Eager

Patch

diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 5b125a64da2..8a9dbc3245a 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -126,7 +126,7 @@  sim_engine_run (SIM_DESC sd,
   int cycs;
   word WLhash;
   ubyte carry;
-  int imm_unsigned;
+  bool imm_unsigned;
   short ra, rb, rd;
   long immword;
   uword oldpc, newpc;