[PATCH] Speed up single-threaded case of atomic ops and reduce text size

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Wed Aug 16 14:31:00 GMT 2006


> Uh, do we build with -Wcast-qual?  There's nothing to get this warning
> shut up unfortunately.

Using a const_cast?

~ bonzinip$ gcc -Wcast-qual -x c++ - -o - -S
int f(volatile int *x) { return *const_cast <int *> (x); }
~ bonzinip$ gcc -Wcast-qual -x c++ - -o - -S
int f(volatile int *x) { return *(int *) (x); }
<stdin>: In function 'int f(volatile int*)':
<stdin>:1: warning: cast from type 'volatile int*' to type 'int*' casts 
away constness
~ bonzinip$

Paolo



More information about the Gcc-patches mailing list