]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Avoid sequence point warning in h8300 sim
authorTom Tromey <tom@tromey.com>
Thu, 8 Apr 2021 21:15:59 +0000 (15:15 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 8 Apr 2021 21:15:59 +0000 (15:15 -0600)
GCC gives a -Wsequence-point warning for this code in the h8300 sim.
The bug is that memory_size is both assigned and used in the same
expression.  The fix is to assign after the print.

sim/h8300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

* compile.c (init_pointers): Fix sequence point warning.

sim/h8300/ChangeLog
sim/h8300/compile.c

index cd47d25f02d4781fcf95c2be10527fc5c8c5e510..2b2c6a73fc06fdc2a5637b279d27d1be05f3b74e 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-08  Tom Tromey  <tom@tromey.com>
+
+       * compile.c (init_pointers): Fix sequence point warning.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * compile.c (cmdline_location): Use new-style declaration.
index c30a738c6d107aea1c3336ada1d92ed4d893b258..c8060b27ab75333b80334438916a09d1a232a04b 100644 (file)
@@ -1624,7 +1624,8 @@ init_pointers (SIM_DESC sd)
          sim_io_printf
            (sd,
             "init_pointers: bad memory size %d, defaulting to %d.\n", 
-            memory_size, memory_size = H8300S_MSIZE);
+            memory_size, H8300S_MSIZE);
+         memory_size = H8300S_MSIZE;
        }
 
       if (h8_get_memory_buf (sd))