[Top][All Lists]

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

Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?

From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?
Date: Thu, 19 Feb 2009 19:48:15 +0100

On Thu, 19 Feb 2009 10:22:23 -0800 (PST)
Parthasaradhi Nayani <address@hidden> wrote:

> Hi Vincent,
> If I understand correctly, the word "volatile" itself is to tell the compiler 
> not to ignore the statement. I am not sure if your statement is correct, but 
> I have used
>  "asm volatile ("nop"::);"

I used this too, because it's what the avr-libc manual shows, however
when I do this, GCC caughs :

lcd.c:96: error: ‘asm’ undeclared (first use in this function)
lcd.c:96: error: (Each undeclared identifier is reported only once
lcd.c:96: error: for each function it appears in.)
lcd.c:96: error: expected ‘;’ before ‘volatile’
make: *** [lcd.o] Error 1

the same avr manual (section 9.6.5, "macros") suggests that using
__asm__ instead of asm (and same for volatile) might help get rid of
warnings. So I tried that and it worked.. so I stick with it ;-)


reply via email to

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