when #ifdeffing a testsnippet it is, often, desirable to be able to do this:
code .... code .... #ifdef DOIT BOOL flag if (flag) ....
Keil does not allow definitions in the middle of a routine, IAR does.
is IAR wrong or is Keil "overly critical"?
since nobody here has a copy of the standard (gotcha sardine) I ask on the forum.
if, indeed, Keil is "overly critical", I'll put in a request.
Erik
For pure 'C', Keil is correct.
Are you sure you haven't got IAR in "C++" mode?
Could you do this:
code .... code .... #ifdef DOIT { BOOL flag if (flag) .... } #endif
Are you sure you haven't got IAR in "C++" mode? who knows, I am now consulting elsewhere, using Keil.
Also, I would be extremely surprised if a C/C++ compiler was totally without allowing any 'innocent' C++ in "C mode", '//' was accepted by many C compilers before it became "legal"