[Debian-lego-team] Bug#1065665: nxt-firmware: implicit type conversion from negative float to char gives 0

Andreas Weber andy at josoansi.de
Fri Mar 8 14:52:21 GMT 2024


Package: nxt-firmware
Version: 1.29.2-1
Severity: important
Tags: upstream

Dear Maintainer, following code debug1.nxc:

task main()
{
   float a = -12.34;
   NumOut(0, 32, a);

   char b = a;
   NumOut(0, 24, b);

   Wait(3000);
}

using nbc 1.2.1.r4+dfsg-11+b1 from Debian bookworm,
compile with
$ nbc debug1.nxc -O=debug1.rxe
upload with
$ nbc -b -d debug1.rxe

with nxt-firmware 1.29.2-1 from Debian bookworm
a948539b318073287733c618ea8d31f2  nxt_firmware.bin

outputs on LCD:
-12.34
0

same with 1.29.4 from upstream.

with NXT Enhanced Firmware, aka John Hansen Firmware, aka NBC/NXC Firmware
a2a17802cde9bf610944757ab7ca6d92  lms_arm_nbcnxc_132_20120810_0021.rfw

outputs on LCD:
-12.34
-12

as expected.

This currently makes OpenRoberta Lab pretty unusable with this firmware 
because many negative float -> char conversions occur

Thank you, Andy



More information about the Debian-lego-team mailing list