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: Optimization/clarity coding : what is gcc able to do for me?


Joe Buck wrote:

It's up to you as a programmer to implement locking if you want to access
any variable longer than a "sig_atomic_t" (which is a typedef that defines
an integral type for which accesses are guaranteed to be atomic on your
system; it is often "int", but might not be).  Pointer accesses are atomic
on every machine that I know of, though I am not certain that the language
standard guarantees this.

It doesn't as far as I know. In Ada there is pragma Atomic to deal with all such cases (Atomic is rejected if atomic access cannot be guaranteed). It might be nice to have an analogous attribute in GNU C.


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