Warning message at compile

kinlougha

New member
Hello,
I have a small bug with the Teensy 4.1 and the RTC library from Makuna, let me explain:

I compile the OnStepX project under VScode and received this warning:

In file included from .pio\libdeps\teensy41\RTC\src\RtcDateTime.cpp:29:
Compiling .pio\build\teensy41\lib7eb\TMCStepper\source\DRVCONF.cpp.o
.pio\libdeps\teensy41\RTC\src\RtcDateTime.h: In member function 'RtcDateTime RtcDateTime::eek:perator+(int32_t) const':
.pio\libdeps\teensy41\RTC\src\RtcDateTime.h:168:41: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'long int'} and 'uint32_t' {aka 'long unsigned int'} [-Wsign-compare]
168 | if (seconds < 0 && abs(seconds) > totalSeconds)

First, I think is a RTC lib problem and open a case to Makuna and received thi answer :


What do you think of that?

Project: OnStepX 10.23a
OS: Window 11
Environment: VScode 1.89.0

CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.18.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy @ 1.158.0 (1.58)
- tool-teensy @ 1.158.0 (1.58)
- toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)

Library:
Dependency Graph
|-- RTC @ 2.4.2
|-- Time @ 1.6.1
|-- TMCStepper @ 0.7.3
|-- LittleFS @ 1.0.0
|-- EEPROM @ 2.0
|-- TimerOne
|-- Wire @ 1.0
|-- SPI @ 1.0
|-- SoftwareSerial @ 1.0
|-- Ethernet @ 2.0.0
|-- OneWire @ 2.3.7
|-- FlexCAN_T4
 
abs() should not return an unsigned type, it is defined as returning the same type as the input.
The proper fix is an explicit cast, like the library author suggested. They added the bug tag to the issue (probably so they could fix it at some point) so you should not have closed it.
 
Thanks Paul,
Michael Miller found a solution that work for me. You can follow the case #209 and #210 on his GitHub.

Alain.
 
Back
Top