diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 5aeff91830..4f77258b2c 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -1816,8 +1816,11 @@ async def to_code(config): Path(__file__).parent / "iram_fix.py.script", ) else: - # Undo IDF's blanket -Werror so third-party libraries and user - # lambdas don't need a -Wno-error= entry per warning class. + # Demote IDF's blanket -Werror to warnings so third-party libs + # and user lambdas don't need a -Wno-error= per warning. + # The sdkconfig knob disables IDF's rewrite to -Werror=all (which + # can't be globally undone); -Wno-error then handles the demotion. + add_idf_sdkconfig_option("CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS", False) cg.add_build_flag("-Wno-error") # -Wno- (not -Wno-error=): suppress entirely, too noisy on C++ aggregates cg.add_build_flag("-Wno-missing-field-initializers")