avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Confusing volatile behaviour with 4.6.2


From: Georg-Johann Lay
Subject: Re: [avr-gcc-list] Confusing volatile behaviour with 4.6.2
Date: Sat, 26 Nov 2011 21:13:00 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Andy Warner schrieb:

Here is what the preprocessor produced for this code:

$ avr-gcc -mmcu=atmega128 -Wall -O2 -g -E test.c
...
void __vector_18 (void) __attribute__ ((signal,used,
externally_visible)) ; void __vector_18 (void)
{
 unsigned char status = (*(volatile uint8_t *)((0x0B) + 0x20));
 unsigned char data = (*(volatile uint8_t *)((0x0C) + 0x20));
 volatile static int slot = (-2);

 if (status & 0x10) {
  if (slot == (-2)) {
   slot++;
  } else {
   goto search;
  }
 } else {
  if ((slot < (-1)) || (++slot > (512))) {
   goto search;
  }
...

You are kidding. The preprocessor does not introcude ... for extra obfuscation ;-)

Johann



reply via email to

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