espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

Fails to compile with (MEGH-5599) #315

Open ricardoquesada opened 3 weeks ago

ricardoquesada commented 3 weeks ago

Answers checklist.

IDF / ESP32-Arduino version.

Using Arduino Core 3.0.1 + ESP-IDF 5.1.4

Operating System used.

Linux

How did you build your project?

Command line with idf.py

Development Kit.

esp32

What is the expected behavior?

I expect it to compile without errors. Used to work with Arduino Core 2.0.17 + ESP-IDF 4.4.7

Using Arduino Core as an ESP-IDF component

What is the actual behavior?

Compilation error:

In function 'esp_rmaker_schedule_parse_info_and_flags',
    inlined from 'esp_rmaker_schedule_parse_json' at /home/riq/progs/esp-idf-arduino-bluepad32-template/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_schedule.c:813:13,
    inlined from 'write_cb' at /home/riq/progs/esp-idf-arduino-bluepad32-template/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_schedule.c:951:5:
/home/riq/progs/esp-idf-arduino-bluepad32-template/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_schedule.c:635:17: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
  635 |                 strncpy(*info, _info, strlen(_info));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

Steps to reproduce.

Compile Arduino Core 3.0.1 as ESP-IDF component.

Build Logs.

n function 'esp_rmaker_schedule_parse_info_and_flags',
    inlined from 'esp_rmaker_schedule_parse_json' at /home/riq/progs/esp-idf-arduino-bluepad32-template/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_schedule.c:813:13,
    inlined from 'write_cb' at /home/riq/progs/esp-idf-arduino-bluepad32-template/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_schedule.c:951:5:
/home/riq/progs/esp-idf-arduino-bluepad32-template/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_schedule.c:635:17: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
  635 |                 strncpy(*info, _info, strlen(_info));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

More Information.

There are already two pull-request that fixes this issue:

Would be great if you can apply one of those.

ricardoquesada commented 3 weeks ago

forgot to mention that this happens when using:

CONFIG_COMPILER_OPTIMIZATION_PERF=y

in sdkconfig.defaults