sqflint
sqflint copied to clipboard
Empty statements and preprocessor control flow
Empty statements are treated as errors:
_x =
{
;
};
The error was initially caused by this:
#define DEBUG_LOG_TRACE
#define Debug_Log_Impl(mode, message) (diag_log format ['mode: %1', message])
#ifdef DEBUG_LOG_TRACE
#define Debug_LogTrace(message) Debug_Log_Impl(TRACE,message)
#else
#define Debug_LogTrace(message)
#endif
Debug_LogTrace("");
_exit =
{
endMission "END1";
};
It seems that the preprocessor flow control is ignored, and Debug_LogTrace("")
is incorrectly expanded as nothing, creating an empty statement. The empty statement in itself is of course perfectly valid.
I'm unable to replicate this issue. Is it possible it's caused by some code before this statement?
It seems the problem is actually empty statements i.e.
_x =
{
;
};
The error was initially caused by this:
#define DEBUG_LOG_TRACE
#define Debug_Log_Impl(mode, message) (diag_log format ['mode: %1', message])
#ifdef DEBUG_LOG_TRACE
#define Debug_LogTrace(message) Debug_Log_Impl(TRACE,message)
#else
#define Debug_LogTrace(message)
#endif
Debug_LogTrace("");
_exit =
{
endMission "END1";
};
It seems that the preprocessor flow control is ignored, and Debug_LogTrace("")
is incorrectly expanded as nothing, creating an empty statement. The empty statement in itself is of course perfectly valid.
Oh, that makes sense. #ifdef
is not yet supported, but the parser should accept the empty statement.
Could you move the last comment to the top, so it's clear what the issue is?