avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Erroneous definition of _MemoryBarrier() in cpufunc.h


From: Ralf Ramsauer
Subject: Re: [avr-libc-dev] Erroneous definition of _MemoryBarrier() in cpufunc.h
Date: Sun, 22 Jan 2017 22:07:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

Thanks David.

I was about to write a patch, when I found out that this issue is
already fixed on mainline [1], since 2013(!).  I'll have to contact
package maintainers of my OS, to mark a more recent version as stable...

Cheers
  Ralf

[1]
https://github.com/vancegroup-mirrors/avr-libc/commit/6323351b344996a4a8c849ae5e2f6c2b10ae5cc0


On 01/22/2017 10:28 AM, David Brown wrote:
> Hi,
> 
> I am not involved in avr-libc development at all, but I've done my bit
> of gcc inline assembly.  And you are correct - you need the empty string
> for the memory barrier.
> 
> mvh.,
> 
> David
> 
> 
> On 21/01/17 17:54, Ralf Ramsauer wrote:
>> Hi,
>>
>> you define _MemoryBarrier() inside avr/cpufunc.h as follows:
>> #define _MemoryBarrier() __asm__ __volatile__(:::"memory")
>> which won't compile in my case:
>>     foo.c:33:2: error: expected string literal before ‘:’ token
>>       _MemoryBarrier();
>>
>> Shouldn't this rather be defined as:
>> #define _MemoryBarrier() __asm__ __volatile__("":::"memory")
>>
>> If someone could confirm this I'll send a short patch.
>>
>> Cheers
>>   Ralf
>>
>> PS: BTW: your project page [0] links to [1], which seems to be a dead
>> link.
>> [0] http://savannah.nongnu.org/cvs/?group=avr-libc
>> [1] http://web.cvs.savannah.nongnu.org/viewcvs/?root=avr-libc
>>


-- 
Ralf Ramsauer
GPG: 0x8F10049B



reply via email to

[Prev in Thread] Current Thread [Next in Thread]