RoboticsBrno / SmartLeds

🚦 Simple & intuitive way to drive various smart LEDs on ESP32.
MIT License
28 stars 12 forks source link

Assert statement causes compilation error with default ESP32 build in platformIO #35

Closed GrantRolls closed 3 years ago

GrantRolls commented 3 years ago

Assert statement causes compilation error with default ESP32 build in platformIO

In file included from C:/Users/Grant/.platformio/packages/framework-espidf/components/newlib/platform_include/assert.h:22,
                 from c:\users\grant\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\8.4.0\cassert:44,
                 from lib/SmartLeds/src/Color.cpp:4:
lib/SmartLeds/src/Color.cpp: In function 'int iRgbSqrt(int)':
lib/SmartLeds/src/Color.cpp:15:57: error: left operand of comma operator has no effect 
[-Werror=unused-value]
     assert(("sqrt input should be non-negative", num >= 0));
                                                         ^
lib/SmartLeds/src/Color.cpp:16:59: error: left operand of comma operator has no effect 
[-Werror=unused-value]
     assert(("sqrt input should no exceed 16 bits", num <= 0xFFFF));
                                                           ^~~~~~
cc1plus.exe: some warnings being treated as errors
*** [.pio\build\esp32-evb\lib287\SmartLeds\Color.o] Error 1
haberturdeur commented 3 years ago

Should be ok now, can you confirm please?

yaqwsx commented 3 years ago

I would also suggest removing the extra pair of braces (they are only confusing).