why is atomic_t a struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

In linux kernel 2.4 atomic.h I see :
/*
18  * Make sure gcc doesn't try to be clever and move
things around
19  * on us. We need to use _exactly_ the address the
user gave us,
20  * not some alias that contains the same
information.
21  */
22 typedef struct { volatile int counter; } atomic_t;

I am wondering why can't we just have 
typedef volatile int counter atomic_t;


Thanks in advance.


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux