Skip to content

Warnings during compilation #4837

Closed
Closed

Description

@vovagorodok

Board / MCU

ESP32

LED Chipset

WS2812B / NeoPixel

FastLED Version

3.10.7

Arduino / PlatformIO version

latest

Operating System

Linux

Description

A lot of warnings during compilation on c++2a:

Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.gfx+.cpp.o
In file included from .pio/libdeps/prototype/FastLED/src/fl/stl/align.h:12,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/compiler_control.h:4,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:28,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/stl/noexcept.h:9:22: warning: optimization attribute on 'void fl::gfx::blur1d(fl::span<fl::CRGB>, fl::fract8)' follows definition but the attribute doesn't match [-Wattributes]
 #define FL_NO_EXCEPT noexcept
                      ^~~~~~~~
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:70:54: note: in expansion of macro 'FL_NO_EXCEPT'
 void blur1d(fl::span<CRGB> leds, fract8 blur_amount) FL_NO_EXCEPT {
                                                      ^~~~~~~~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/gfx/colorutils.h:12,
                 from .pio/libdeps/prototype/FastLED/src/colorutils.h:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:104,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.h:33:13: note: previous definition of 'void fl::gfx::blur1d(fl::CRGB*, fl::u16, fl::fract8)' was here
 inline void blur1d(CRGB *leds, u16 numLeds, fract8 blur_amount) FL_NO_EXCEPT {
             ^~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/stl/align.h:12,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/compiler_control.h:4,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:28,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/stl/noexcept.h:9:22: warning: optimization attribute on 'void fl::gfx::blur2d(fl::span<fl::CRGB>, fl::u8, fl::u8, fl::fract8, const fl::XYMap&)' follows definition but the attribute doesn't match [-Wattributes]
 #define FL_NO_EXCEPT noexcept
                      ^~~~~~~~
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:89:53: note: in expansion of macro 'FL_NO_EXCEPT'
             fract8 blur_amount, const XYMap &xymap) FL_NO_EXCEPT {
                                                     ^~~~~~~~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/gfx/colorutils.h:12,
                 from .pio/libdeps/prototype/FastLED/src/colorutils.h:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:104,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.h:56:13: note: previous definition of 'void fl::gfx::blur2d(fl::CRGB*, fl::u8, fl::u8, fl::fract8, const fl::XYMap&)' was here
 inline void blur2d(CRGB *leds, u8 width, u8 height, fract8 blur_amount,
             ^~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/stl/align.h:12,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/compiler_control.h:4,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:28,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/stl/noexcept.h:9:22: warning: optimization attribute on 'void fl::gfx::blurRows(fl::span<fl::CRGB>, fl::u8, fl::u8, fl::fract8, const fl::XYMap&)' follows definition but the attribute doesn't match [-Wattributes]
 #define FL_NO_EXCEPT noexcept
                      ^~~~~~~~
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:135:55: note: in expansion of macro 'FL_NO_EXCEPT'
               fract8 blur_amount, const XYMap &xyMap) FL_NO_EXCEPT {
                                                       ^~~~~~~~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/gfx/colorutils.h:12,
                 from .pio/libdeps/prototype/FastLED/src/colorutils.h:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:104,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.h:78:13: note: previous definition of 'void fl::gfx::blurRows(fl::CRGB*, fl::u8, fl::u8, fl::fract8, const fl::XYMap&)' was here
 inline void blurRows(CRGB *leds, u8 width, u8 height, fract8 blur_amount,
             ^~~~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/stl/align.h:12,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/compiler_control.h:4,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:28,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/stl/noexcept.h:9:22: warning: optimization attribute on 'void fl::gfx::blurColumns(fl::span<fl::CRGB>, fl::u8, fl::u8, fl::fract8, const fl::XYMap&)' follows definition but the attribute doesn't match [-Wattributes]
 #define FL_NO_EXCEPT noexcept
                      ^~~~~~~~
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:174:58: note: in expansion of macro 'FL_NO_EXCEPT'
                  fract8 blur_amount, const XYMap &xyMap) FL_NO_EXCEPT {
                                                          ^~~~~~~~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/fl/gfx/colorutils.h:12,
                 from .pio/libdeps/prototype/FastLED/src/colorutils.h:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/fastled.h:104,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/blur.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/gfx/_build.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.gfx+.cpp:10:
.pio/libdeps/prototype/FastLED/src/fl/gfx/blur.h:90:13: note: previous definition of 'void fl::gfx::blurColumns(fl::CRGB*, fl::u8, fl::u8, fl::fract8, const fl::XYMap&)' was here
 inline void blurColumns(CRGB *leds, u8 width, u8 height, fract8 blur_amount,
             ^~~~~~~~~~~
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.log+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.math+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.net+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.net.ota+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.remote+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.sensors+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.stl+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.system+.cpp.o
In file included from .pio/libdeps/prototype/FastLED/src/platforms/atomic.h:18,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/atomic.h:12,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/shared_ptr.h:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/basic_string.h:17,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/string.h:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/allocator.cpp.hpp:7,
                 from .pio/libdeps/prototype/FastLED/src/fl/stl/_build.cpp.hpp:6,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.stl+.cpp:10:
.pio/libdeps/prototype/FastLED/src/platforms/shared/atomic.h: In static member function 'static int fl::asio::http::Server::handle_esp_request(void*)':
.pio/libdeps/prototype/FastLED/src/platforms/shared/atomic.h:98:43: warning: invalid failure memory model for '__atomic_compare_exchange' [-Winvalid-memory-model]
         return __atomic_compare_exchange_n(&mValue, &expected, desired,
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           false, // strong
                                           ~~~~~~~~~~~~~~~~
                                           order, order);
                                           ~~~~~~~~~~~~~
.pio/libdeps/prototype/FastLED/src/platforms/shared/atomic.h: In member function 'virtual void fl::asio::http::Server::ServerAsyncRunner::update()':
.pio/libdeps/prototype/FastLED/src/platforms/shared/atomic.h:98:43: warning: invalid failure memory model for '__atomic_compare_exchange' [-Winvalid-memory-model]
         return __atomic_compare_exchange_n(&mValue, &expected, desired,
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           false, // strong
                                           ~~~~~~~~~~~~~~~~
                                           order, order);
                                           ~~~~~~~~~~~~~
In file included from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native.hpp:18,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32.hpp:16,
                 from .pio/libdeps/prototype/FastLED/src/platforms/pin.h:19,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/pin.cpp.hpp:30,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/_build.cpp.hpp:8,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.system+.cpp:10:
.pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native_impl.hpp: In function 'fl::u16 fl::platforms::analogRead(int)':
.pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native_impl.hpp:174:40: warning: 'ADC_ATTEN_DB_11' is deprecated [-Wdeprecated-declarations]
     adc1_config_channel_atten(channel, ADC_ATTEN_DB_11);
                                        ^~~~~~~~~~~~~~~
In file included from /home/vova/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/driver/include/driver/adc.h:14,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native_impl.hpp:38,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native.hpp:18,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32.hpp:16,
                 from .pio/libdeps/prototype/FastLED/src/platforms/pin.h:19,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/pin.cpp.hpp:30,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/_build.cpp.hpp:8,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.system+.cpp:10:
/home/vova/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/hal/include/hal/adc_types.h:54:5: note: declared here
     ADC_ATTEN_DB_11 __attribute__((deprecated)) = ADC_ATTEN_DB_12,  ///<This is deprecated, it behaves the same as `ADC_ATTEN_DB_12`
     ^~~~~~~~~~~~~~~
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.system.analog+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.system.sd+.cpp.o
Compiling .pio/build/prototype/libb6b/FastLED/fl/build/fl.task+.cpp.o
In file included from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native.hpp:18,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32.hpp:16,
                 from .pio/libdeps/prototype/FastLED/src/platforms/pin.h:19,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/analog/analog_read.cpp.hpp:11,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/analog/_build.cpp.hpp:8,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.system.analog+.cpp:15:
.pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native_impl.hpp: In function 'fl::u16 fl::platforms::analogRead(int)':
.pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native_impl.hpp:174:40: warning: 'ADC_ATTEN_DB_11' is deprecated [-Wdeprecated-declarations]
     adc1_config_channel_atten(channel, ADC_ATTEN_DB_11);
                                        ^~~~~~~~~~~~~~~
In file included from /home/vova/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/driver/include/driver/adc.h:14,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native_impl.hpp:38,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32_native.hpp:18,
                 from .pio/libdeps/prototype/FastLED/src/platforms/esp/32/pin_esp32.hpp:16,
                 from .pio/libdeps/prototype/FastLED/src/platforms/pin.h:19,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/analog/analog_read.cpp.hpp:11,
                 from .pio/libdeps/prototype/FastLED/src/fl/system/analog/_build.cpp.hpp:8,
                 from .pio/libdeps/prototype/FastLED/src/fl/build/fl.system.analog+.cpp:15:
/home/vova/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/hal/include/hal/adc_types.h:54:5: note: declared here
     ADC_ATTEN_DB_11 __attribute__((deprecated)) = ADC_ATTEN_DB_12,  ///<This is deprecated, it behaves the same as `ADC_ATTEN_DB_12`
     ^~~~~~~~~~~~~~~

Steps to reproduce

Add to platformio.ini

build_flags =
	-std=c++2a
	-std=gnu++2a
build_unflags =
	-std=gnu++11

Minimal sketch

Serial / debug output

Checklist

  • I have searched existing issues for duplicates
  • I have tested with the latest FastLED release or git master
  • I can reproduce this with a minimal sketch

Activity

  1. added
    status: triage
    type: bug
    on Oct 14, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    Member

    Most of this is now fixed on master, and the remainder is an upstream toolchain bug — details below.

    Fixed in #4932 (commit 8d1b44d2d, will be in the pending release)

    • -Winvalid-memory-model on fl::AtomicReal::compare_exchange_*. The success memory order was being reused as the failure order, and the default (memory_order_acq_rel) — plus memory_order_release — is not a legal failure order for __atomic_compare_exchange_n, so GCC warned on every instantiation. src/platforms/shared/atomic.h now derives the failure order the way std::atomic implementations do (acq_rel → acquire, release → relaxed), and tests/fl/stl/atomic.cpp covers the success and failure paths for all five orders.
    • ADC_ATTEN_DB_11 deprecation on ESP-IDF. The IDF 4.x analogRead stub in src/platforms/esp/32/pin_esp32_native_impl.hpp no longer names the deprecated constant (nor ADC_ATTEN_DB_12, which not every 4.x SDK defines); it uses the stable underlying attenuation value instead.

    Not a FastLED defect: -Wattributes on blur1d/blur2d/blurRows/blurColumns

    warning: optimization attribute on 'void fl::gfx::blur1d(fl::span<fl::CRGB>, fl::fract8)'
             follows definition but the attribute doesn't match [-Wattributes]
     ... blur.h:33: note: previous definition of 'void fl::gfx::blur1d(fl::CRGB*, fl::u16, fl::fract8)' was here
    

    Note the two signatures in the diagnostic: they are different overloads. Every declaration and definition in src/fl/gfx/blur.h / blur.cpp.hpp already carries FL_NO_EXCEPT with a matching noexcept specifier, and there is nothing to make consistent:

    • void blur1d(fl::span<CRGB>, fract8) FL_NO_EXCEPT; (declaration, blur.h:30)
    • inline void blur1d(CRGB*, u16, fract8) FL_NO_EXCEPT { … } (inline overload, blur.h:33)
    • void blur1d(fl::span<CRGB>, fract8) FL_NO_EXCEPT { … } (definition, blur.cpp.hpp:70)

    The warning comes from the xtensa GCC 8.4 shipped with arduino-esp32 2.x, which still treats noexcept as an "optimization attribute", tracks it per function name rather than per overload, and therefore reports a mismatch between two overloads of the same function. It does not reproduce on GCC 13 (the compiler in arduino-esp32 3.x), and none of the FL_*-macro or overload structure can be changed to silence it without dropping the legacy raw-pointer overloads.

    Action: upgrade to arduino-esp32 3.x (ESP-IDF 5.x), which replaces that toolchain. This warning disappears and does not need a FastLED change.

    Closing as fixed for the two source-level warning classes; reopen or comment if you still see any warning on arduino-esp32 3.x with the pending release.

  3. moved this from Triage to Done in FastLED Trackeron Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions