Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
STR problem (*solved*)
#10
LCD Wrote:
boriel Wrote:
LCD Wrote:
Code:
dim a as ubyte
dim b as uinteger
a=20
print a
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:
"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 failed
the 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.
Yes, I'm a donkey, that's the reason... It works if I compile first and then start the emulator, not if I start the batch operation (compile and then start the emulator automaticaly).
I'm using a IDE which does not start the emulator after compilation if something was sent over the stderr channel (because it supposes to be a error which aborts the compilation). Could you please change the output to send such messages to the normal std program output, like the other compiler (optimisations) warnings?

Sorry for the delay. You might guess I've been really busy these days.
Back to the topic:

zxb.exe already returns an errorlevel <> 0 if there were an error (this is the standard behavior). You can however tell the compiler to use a different file (--stderr), but it will not separate warnings from errors. I suppose I will have to add a flag for that.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)