Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.40 max() Function Compiling Error #1549

Closed
reloxx13 opened this issue Jan 8, 2018 · 1 comment
Closed

v2.40 max() Function Compiling Error #1549

reloxx13 opened this issue Jan 8, 2018 · 1 comment

Comments

@reloxx13
Copy link
Contributor

reloxx13 commented Jan 8, 2018

Heya aren,

got this for you:
(Ah, i suggested the user to update the packages with Atom, did not response now, ill give feedback if this solves it.)

Archiving .pioenvs\sonoff\lib741\libNeoPixelBus_by_Makuna.a
lib\IRremoteESP8266\IRKelvinator.cpp: In member function 'void IRKelvinatorAC::setTemp(uint8_t)':
lib\IRremoteESP8266\IRKelvinator.cpp:96:41: error: no matching function for call to 'max(unsigned int, uint8_t&)'
temp = max(KELVINATOR_MIN_TEMP, temp);
^
lib\IRremoteESP8266\IRKelvinator.cpp:96:41: note: candidates are:
In file included from c:\users\hw_note006.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include

c:\users\hw_note006.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>,
_Compare)
max(initializer_list<_Tp> __l, _Compare __comp)
^

Thanks for the heads up that v2.4.0 has finally been released. Dang, I was hoping this would be fixed before it was officially released.

The problem stems from the way the arithmetic min() and max() functions are implemented. Before v2.4.0 they were implemented as macros and the macro parameters could be of different data types (byte, int, long or whatever). With v2.4.0 min() and max() are now implemented using the std::min and std::max library and both function parameters have to be the same data type, the compiler won't do implicit type conversion. :(

So probably the easiest solution is to explicitly cast one of the two parameters when they are different data types. The WS2812FX library needs to be tweaked in two places.

kitesurfer1404/WS2812FX#58 (comment)

FullLog:
log.txt

@arendst
Copy link
Owner

arendst commented Jan 8, 2018

You seem to use the old libraries. Pls update with the latest libraries as provided with release 5.11.1

EDIT: I've been testing with 2.4.0-RC2 way back and tried to solve these min/max issues by providing the latest libraries. As I do not own the I2Cdevlib library I have provided an alternative one for the ADS1115 device. So ther should be no issue with min/max and Tasmota.

@reloxx13 reloxx13 closed this as completed Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants