Subject: Re: gcc4 status
To: None <tech-toolchain@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-toolchain
Date: 05/23/2006 13:31:01
> Is this patch acceptable to suppress gcc4's
> "left-hand operand of comma expression has no effect"
> warning, or is there any better answer?

> @@ -531,9 +531,9 @@
>   *
>   * On the MIPS, we just flush the write buffer.
>   */
> -#define	bus_space_barrier(t, h, o, l, f)	\
> -	((void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f)),	\
> -	 wbflush())
> +#define	bus_space_barrier(t, h, o, l, f)				\
> +	(wbflush(),							\
> +	 (void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f)))
>  #define	BUS_SPACE_BARRIER_READ	0x01		/* force read barrier */
>  #define	BUS_SPACE_BARRIER_WRITE	0x02		/* force write barrier */
>  

I don't know about the rest of it, but it seems to me that this has
order-of-evaluation problems: it evaluates its arguments *after*
performing the write barrier, not *before*.  (This usually won't
matter, but if one of the arguments is, for example, a function call
that does a significant amount of work, it may.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B