mirror of https://github.com/rusefi/fome-fw.git
CI can protect us from loss of precision (#424)
This commit is contained in:
parent
8c8d18e435
commit
0097eb583b
|
@ -303,6 +303,10 @@ jobs:
|
|||
- name: Build Firmware
|
||||
run: bash misc/jenkins/compile_other_versions/compile.sh ${{matrix.folder}} ${{matrix.build-target}}
|
||||
|
||||
- name: Check for illegal time conversions
|
||||
working-directory: ./firmware/
|
||||
run: bash check_illegal_conversion.sh
|
||||
|
||||
# Build rusEFI console
|
||||
- name: Build console
|
||||
if: ${{ env.full == 'true' }}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# Trying to convert float -> long suggests you're probably trying to compute a
|
||||
# time period in float, then add it to a timestamp to get some time in the future.
|
||||
# If you do this naively, it'll try and do
|
||||
# float offset;
|
||||
# int64_t stamp;
|
||||
# int64_t result = (int64_t)((float)stamp + offset);
|
||||
# The resulting loss of precision is unacceptable.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if grep "bl.*<__aeabi_f2lz>" build/fome.list; then
|
||||
echo "Illegal float-to-long conversion detected!"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue