This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]