From fd6fa7c56a209cb5d4fa15f59a837b88795529ee Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 8 Sep 2013 11:05:23 -0400 Subject: [PATCH] Fix compiler warning (and potential bug) in auto-generated 8051 instructions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Original warning: warning: operation on ‘cpu8051.pc’ may be undefined [-Wsequence-point] --- src/opcode2c.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opcode2c.pl b/src/opcode2c.pl index a80f651..0b11438 100755 --- a/src/opcode2c.pl +++ b/src/opcode2c.pl @@ -230,7 +230,8 @@ for ($i=0 ; $i< 256; $i++) { if ($instargs[$i*4] > 0) { $op_destination=$instargs[$i*4+1]; if ($op_destination == 0) { # addr11 - print INST_IMP " unsigned int addr11 = ( ( memory_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + memory_read8( PGM_MEM_ID, cpu8051.pc++ );\n"; + print INST_IMP " unsigned int addr11 = ( ( memory_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + memory_read8( PGM_MEM_ID, cpu8051.pc );\n"; + print INST_IMP " cpu8051.pc++;\n"; } if ($op_destination == 1) { # addr16 print INST_IMP "unsigned int addr16 = ( memory_read8( PGM_MEM_ID, cpu8051.pc++ ) << 8 );\n"; -- 2.20.1