On Tue, 21 Jan 2014, Marek Polacek wrote:

--- gcc/libdecnumber/decNumberLocal.h.mp        2014-01-21 18:34:32.235540589 
+0100
+++ gcc/libdecnumber/decNumberLocal.h   2014-01-21 19:04:12.173243034 +0100
@@ -155,8 +155,10 @@ see the files COPYING3 and COPYING.RUNTI
  /* Store a uInt, etc., into bytes starting at a char* or uByte*.    */
  /* Returns i, evaluated, for convenience; has to use uiwork because */
  /* i may be an expression.                                          */
-  #define UBFROMUS(b, i)  (uswork=(i), memcpy(b, (void *)&uswork, 2), uswork)
-  #define UBFROMUI(b, i)  (uiwork=(i), memcpy(b, (void *)&uiwork, 4), uiwork)
+  #define UBFROMUS(b, i)  (uswork=(i), memcpy(b, (void *)&uswork, 2), \
+                          (void)uswork)
+  #define UBFROMUI(b, i)  (uiwork=(i), memcpy(b, (void *)&uiwork, 4), \
+                          (void)uiwork)

This looks wrong to me. The comment before says that those macros "return" uiwork, so you can't cast it to void in the macro. Options:

1) cast to void in the users of the macro:
(void) UBFROMUS(acc+4, 0);

2) Make the macros not return (since none of the users use the return value), i.e. remove ", uiwork" at the end and update the comment before. (you may need to cast the return of memcpy to void, which makes more sense)

--
Marc Glisse

Reply via email to