05-12-2009, 07:44 PM
LCD Wrote:If you compile these lines (not using variable b), the compiler should only ignore the fact, variable b is not used, but it stops with this message:Code:dim a as ubyte
dim b as uinteger
a=20
print a
"temp.bas:2: warning: Variable 'b' is never used Errors occured, compilation failed"
It occurs only with optimisation levels 1-3, but not if no optimisation is selected.
This is what I get:
Quote:zxb temp.bas -O2 -T -B -a
temp.bas:2: warning: Variable 'b' is never used
INFO: __PRINTU8 is not defined. No optimization is done.
INFO: PRINT_EOL is not defined. No optimization is done.
I also see something strange in this error message:
Quote:temp.bas:2: warning: Variable 'b' is never used Errors occured, compilation failedthe bold letters are not part of the compiler message! :?:
I also get the warning, but the program gets compiled, and temp.tzx file is created.
Perhaps you're using an external IDE / script to compile? Notice that warnings are also send to stderr output (like error messages), because many programs expect them this way.