Hi Kyle,
On 07/12/12 06:21 pm, zmafoox wrote:
It seems every time I'm about to release the next jalv2 version
Glad to hear there is still hope for a new compiler version ;)
something crops up. Today I'm compiling all samples and ran into the
following with sample/16f648a_serial_format.jal
lib/usart_common.jal:62: warning: boolean expression expected
it turns out this is caused by:
const usart_hw_serial = true -- true = RS232, false = SPI;@jallib
section serial
arguably this is indeed an error, what do others think?
The compiler - at least the version you are working on - seems to be
stricter than previous versions: I don't get this warning with 2.4o, not
even with the latest published 2.4p-beta. It seems to insist on getting
a bit-value.
The compiler documentation is not completely clear in this: the
definition of 'lexpr' says that the result is '0' or '1', but it does
not say it must be a bit-value. The confusing part of the definition of
'lexpr' is:
'and 1 if the expression is anything other than 0'
I interpret this as: it must not be a bit value but I (the compiler)
treat every non-zero variable (regardless type) as a bit '1'.
Only if 'lexpr' must evaluate to a bit-value you can say the sample is
in error, and the proper declaration would then be:
const bit usart_hw_serial = TRUE
BTW: - this is the default in usart_common.jal when
usart_hw_serial is not specified by the program
- 'TRUE' is defined as bit in constants_jallib.jal
My €.02
Regards, Rob.
--
R. Hamerling, Netherlands --- http://www.robh.nl
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.