[parisc-linux] gcc and ++

Matthew Wilcox willy@debian.org
Wed, 2 Oct 2002 14:22:20 +0100


On Wed, Oct 02, 2002 at 03:01:32PM +0200, phi wrote:
> Wouldn't be 'natural' to declare ++ a sequence point as well as comma is since
> it has side effects, beside it would remove the sequence-point jazz in the
> warning emits.

*boggle*.  i suggest you get hold of a copy of the C spec or a good
book on the C programming language.  What you are doing is _explictly_
undefined by the specification.  The compiler is free to emit
whatever code it likes.  GCC doesn't warn for the fun of it, you know.
http://www.eskimo.com/~scs/C-faq/q3.1.html gives some more detail.

> Right now the macro look like this for flawed/featured gcc.
> 
> #define get3_4(p) ({register uint32
> t=(*p++)<<24;t+=(*p++)<<16,t+=(*p++)<<8,t+(*p++);})

i thought you were trying to write portable code; the ({ ... }) is a
gcc extension.

-- 
Revolutions do not require corporate support.