inlining using C99

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using the latest WinAVR build I have found a problem with the always_inline attribute failing to work in C99 mode - it generates an inlining failed to call error. The -fgnu89-inline compiler option only appears to work with the inline and gnu_inline attributes.

Is there a workround for this as I would like to use C99.

Regards,

-=mike=-

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

-std=c99 or -std=gnu99?

Can you post a compilable code snippet to reproduce this?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jörg,

I tried both gnu99 and c99 switches and both failed ( I assume that the -fgnu89-inline option only works with the gnu99 switch).

The function is:

inline void WatchdogMonitorTask(watchdog_t task) __attribute__((always_inline));

inline void WatchdogMonitorTask(watchdog_t task)
{
    wdFlags |= task;
}

It could have been written as a macro but I like the fact that the compiler is "static checking" my code :)

Regards,

-=mike=-