http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57926
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-07-18
Ever confirmed|0 |1
Severity|major |normal
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The test is broken, i should be the same type as Mutex. This should compile
though:
long Mutex[1];
int AcquireLogMutex(void)
{
return __atomic_exchange_n(Mutex, 1, __ATOMIC_SEQ_CST);
}
void ReleaseLogMutex(void)
{
long i = 0;
__atomic_store(Mutex, &i, __ATOMIC_SEQ_CST);
}
G++ doesn't do the array-to-pointer conversion
There's a simple workaround: just use (long*)Mutex