boriel wrote:The compiler is *not* failing at all. It's just a merely warning. That was what I was telling LCD previously. According to my tests it is returning a 0 return code (success). I will try on Windows, as the .exe version might be returning something different...
I think there's some confusion. That's exactly what I was saying - there isn't a problem, and all is good!
boriel wrote:This is what most compilers do. The warning is a warning because undeclared vars are Float by default with 0 value. So POKE Addr1, aValue (which is the same as Poke Byte Addr1, aValue), translates to POKE 0, 0. Addr1 is converted to Uinterger since a ZX Spectrum Memory address is always a 16 bit integer. Then aValue is converted to the given type to POKE (by default, a byte). If you do POKE @unknown, aValue, then the @unknown type is ok: it's always a memory address (the @operator returns that), but aValue is a float and must be rounded to a byte. That's the warning.
Again, I thought I said exactly the same thing. Hmm.
boriel wrote:[*] Warnings mean "Warning!", "Achtung!". If a program causes warnings, they must be examined one by one to see if they are potential bugs or not.
Two issues here - warnings are easy to miss in something like Tommygun (waiting for BorIDE), because of the limited space - and all you get to read easily is the end "compiled" message.
Secondly, if it's a warning, and bizarrely you decide you're okay with that, you're stuck with that, and all other warnings you're okay with when compiling the whole project forever. Also easy to lose one. Code should be warning free!
(any way to say "this line is okay, don't warn?")
boriel wrote:[*] Avoid lower/uppercase mistyping by adding #pragma case_insensitive = TRUE at the beginning of your program (--case-insensitive still not exported to the command line)
#pragma is completely undocumented. I know there are some, but apart from the odd snippet like this, I have no idea how to use that. I assume it can come from freebasic....?
boriel wrote:[*] There will be a flag --Werror (used in GNU gcc among others) that will turn warnings into errors.
[*] There will be a flag to enforce variable declarations with --explicit or #pragma explicit (FreeBasic uses #pragma equivalent Option Explicit).[/list]
So just wait for the last 2 points, or examine them closely. I'm working slower now in the compiler (writing the Wiki), but all of this will be done.
Now you're talking! Those will be very helpful for fixing up projects for someone as typo prone as I am. I miss capitalization all the time.
I also miss brackets, end asm/end function, end sub and end if, as well. Can the compiler explain better why it's stuck, instead of just "unexpected end of file" ?
For example if it said "Unexpected end of file, FOR loop in Line 20 is not closed" that would be an amazing improvement.
Similarly for all the others - asm/IF/SUB/Function/Brackets....