In the GHS compiler, if you have multiple semicolons in a row without any intervening statements, this generates a diagnostic message (warning). For example:
void myfunc()
{
}; // warning #381-D: extra ';' ignored.
This doesn't seem like a very common situation, but this warning is also issued after preprocessing has occurred, such that, the following would also generate the warning (when compiled in release):
#if _DEBUG
#define DEBUG_VAR(x) x
#else
#define DEBUG_VAR(x)
#endif
void myfunc()
{
}
// global variable, used only in debug
DEBUG_VAR(int x); // warning #381-D: extra ';' ignored.
I realize that there are easy ways to workaround this in this case, it is just an illustrative example. There are many other situations with the preprocessor where you might end up with a similar construct.
Obviously, the code is legal c++, and I have never encountered such a warning message on any other compiler I have used. Is there some reasonable explanation of why this warning would be helpful, for example, is there a specific case where this warning might indicate a programming error?