Description The ARM C compiler warns of 'junk at end of #endif line - ignored' Solution Some other C compilers may silently ignore characters following arguments to preprocessor directives. The ARM C compiler is much stricter in its interpretation of the C language. The problem is probably caused by code like:
#ifdef SOMETHING : #endif SOMETHING
The #endif does not expect or require any argument. Enclosing the trailing part of the line in a comment should cure the problem:
#endif /* SOMETHING */
Another workaround is to configure the compiler options to disable this type of warning. The compiler option for this is '-Ep'. For the ARM Project Manager (APM), select Project->Tool Configuration->cc->set, then select the 'Errors' tab and uncheck the 'Junk at end of #endif/#else/#undef' box.
|