[Gllug] C function strcasecmp

Alex Hudson home at alexhudson.com
Sat Jul 28 10:06:44 UTC 2001


On Sat, Jul 28, 2001 at 12:13:48AM +0100, Nix wrote:
> > 	*x+=~(*x)++;
> 
> Foul and invokes undefined behaviour; multiple modifications with no
> intervening sequence points ;P

Yes. Your problem being ? :)) 

Given it worked when I compiled it, that's enough QA for participation in
this thread I feel ;) 

> > 	*x%=1;	// possibly the worst?
> 
> *sob*

Having thought about this a bit now, I want to start grepping through code
for examples in the wild :) Theoretically, gcc could optimize the above
statement to 0 pretty easily, I wonder if it does...

[Playing with gcc:

	movb $0,-8(%ebp)

eek! it _does_ optimize it to x[0]=0!!]

Cheers,

Alex.

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list