This is the mail archive of the gcc@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: An error of gcc-ss-20030303


On Wed, 23 Apr 2003, Jie Zhang wrote:

> The following code is copied from spinlock.c in uClibc (after 
> preprocessing and 'inline' after static removed):
> 
> static void __pthread_release(int * spinlock)
> {
>   asm ("" : : : "memory");
>   *spinlock = 0;
>   __asm __volatile ("" : "=m" (*spinlock) : "0" (*spinlock));
> }
> 

Why not use a pointer to a volatile int?

Toshi



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