gsc-tool icon indicating copy to clipboard operation
gsc-tool copied to clipboard

[preprocessor]: Unreachable blocks still processed for some macros

Open diamante0018 opened this issue 11 months ago • 2 comments

#define TEST

#ifndef TEST
#error How did this happen
#endif

main()
{
}

Expected behaviour:

#error block should not be processed at all even though it's technically unsupported because ifndef TEST should never trigger because we defined TEST two lines before.

This is the case for C++ compilers

image

Unexpected behaviour:

.\gsc-tool.exe -m comp -g iw5 -s pc .\a.gsc
GSC Tool 1.4.3.297-prod created by xensik
[ERROR]:preprocessor:./a.gsc:4:2: #error directive not supported at ./a.gsc

diamante0018 avatar Mar 20 '24 10:03 diamante0018