-1

I've an old code that perfectly works in IAR IAR 7.60

I would like to port it to IAR 9.20.4. The only issue while compiling is that I got a __no_operation(); line of code that generates an error while compiling

IAR reports the error as

Error[Li005]: no definition for "__no_operation" [referenced from C:\[...]\EWARM\F041701a_beta000\Obj\Application\User\93c66.o]         

And also got a warning

Warning: implicit declaration of function '__no_operation' is invalid in C99

Is there a way to work around, resolve the issue?

I can't find a solution at the moment.

I'm using an STM32F0

NicoCaldo
  • 1,171
  • 13
  • 25
  • You are misreading the warning message. It does not tell you that `__no_operation` is invalid as you state in your title. It tells you that *implicit declarations* are invalid. There must be some header to include for your toolset that brings the required prototypes for intrinsic functions. – Gerhardh Jul 28 '22 at 13:23

2 Answers2

3

you need to add to your program:

#include "intrinsics.h"

Which defines this inline function.

0___________
  • 60,014
  • 4
  • 34
  • 74
0

Using __iar_builtin_no_operation(); instead of __no_operation(); fixed the issue

NicoCaldo
  • 1,171
  • 13
  • 25