Declaration order causes inconsistency in expression.

Skip to first unread message

Leonardo Hirokazu De Souza Hamada

Aug 24, 2021, 9:15:02 AM8/24/21
to jallist
Hi, I assume there isn't a bug report on this yet. I don’t think I’ve seen on the bug entry list, so here it goes. I've stepped on the following issue on the code below:

var word cond = 123
var byte key = 16
if (0 == key) | (0 == cond) then
     print_string(serial_hw_data, "Shouldn't print.\r\n")
end if

If the word type variable is declared before the byte variable the if condition is satisfied, which is unexpected for the values given initially. (I'm using a 18f4620)

; This is OK, only the variable declaration order differ.
;var byte key = 16
;var word cond = 123
;if (0 == key) | (0 == cond) then
; print_string(serial_hw_data, "Shouldn't print.\r\n")
;end if

Best regards,


Rob CJ

Aug 24, 2021, 2:18:07 PM8/24/21
Hi Leonardo,

Very surprising to see the bugs that you discover since they where not discoved before. I registered your issue under:

As said I will have a look at it later but currently I am working on an improvement of the JAL USB driver (if I will manage).

Kind regards,


Van: 'Leonardo Hirokazu De Souza Hamada' via jallist <>
Verzonden: dinsdag 24 augustus 2021 15:15
Aan: jallist <>
Onderwerp: [jallist] Declaration order causes inconsistency in expression.
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Sep 5, 2021, 3:01:33 AM9/5/21
to jallist
Hi Leonardo,

I think I fixed this issue but requires some more testing. If it works OK I first want to look at the other issue you reported about the calculation in the SD Word before adding the new compiler version to the bee-package.

Kind regards,


Op dinsdag 24 augustus 2021 om 20:18:07 UTC+2 schreef
Reply all
Reply to author
0 new messages