Closed abradd closed 7 months ago
Because +define+FORMAL is not on the slang command line, the pre-processor completely removes all code within the `ifdef FORMAL, so compile can't flag the error because the code doesn't exist now.
Yes, that's right. slang won't even try to open the include file here so it doesn't matter what you put into it.
Because +define+FORMAL is not on the slang command line
Sorry about that, I was testing with and without -DFORMAL
, but it seems I posted the one without.
If I run:
slang -Weverything -DFORMAL slang_test.sv
after removing the `endif
from slang_include.sv
I still don't see an error. Is there something else I'm missing?
Ok yeah, looks like there's still a bug here, specifically with include files.
Fixed in 918f4f44a81b5e5aab56e09caf89a4c5a2ec7697
Describe the bug
With the following code in file
slang_test.sv
:where
slang_include.sv
is given by:Removing the
`endif
fromslang_include.sv
reports no errors. Removing either`endif
inslang_test.sv
will report an error for the missing`endif
directive.To Reproduce
Create the two files above and run: