You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
platform: avrArduino Uno, Mega, ATtinysanitizedTitle, body and conversation screened; review text requires separate screening.type: bugSomething is broken
On AVR int is 16 bits, so 4 << 16 shifts past the width of the type. avr-gcc 7.3 rejects it ("left shift count >= width of type", hard error in a constexpr context); with -fpermissive it compiles to a wrong value (0), which would make the gamut probe ceiling zero and break gamut mapping on AVR.
Found while measuring stack usage of all src/fl/build/*.cpp unity files with avr-gcc -fstack-usage (same 16-bit-int bug class as #5301).
Sweep src/ for other integer-literal shifts by >= 16 that rely on 32-bit int (a grep of constexpr i32/u32 X = N << 16..31 found only this one, but also check non-constexpr and #define forms).
Consider a lint rule (Rust linter in ci/lint_cpp_rs/) that flags a bare int literal shifted left by >= 16 in src/, since host tests can't catch this class.
Verify with an avr-gcc compile of the unity file without -fpermissive.
platform: avrArduino Uno, Mega, ATtinysanitizedTitle, body and conversation screened; review text requires separate screening.type: bugSomething is broken
Activity
fix(avr): widen int literal shifts >= 16 that overflow 16-bit int (Fa…