Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix glb_clk may be uninitialized build error in ledc driver (IDFGH-7450) #9025

Closed

Conversation

tamisoft
Copy link
Contributor

I am not sure if this is a complete solution to the problem, but at least it seems to fix it on esp32.
The issue was introduced in: d64c6f5 ledc: cleanup the clock selection code

The offending line is a print: line 570: ESP_LOGD(LEDC_TAG, "In slow speed mode, global clk set: %d", glb_clk);

Am I missing something else here?

build error:

In file included from components/driver/ledc.c:10:
components/driver/ledc.c: In function 'ledc_set_timer_div':
components/log/include/esp_log.h:419:47: error: 'glb_clk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_SYSTEM_TIME_FORMAT(D, format), esp_log_system_timestamp(), tag, ##VA_ARGS); }
^~~~~~~~~~~~~
components/driver/ledc.c:497:25: note: 'glb_clk' was declared here
ledc_slow_clk_sel_t glb_clk;
^~~~~~~

Fixes build error:

In file included from components/driver/ledc.c:10:
components/driver/ledc.c: In function 'ledc_set_timer_div':
components/log/include/esp_log.h:419:47: error: 'glb_clk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         else if (level==ESP_LOG_DEBUG )     { esp_log_write(ESP_LOG_DEBUG,      tag, LOG_SYSTEM_TIME_FORMAT(D, format), esp_log_system_timestamp(), tag, ##__VA_ARGS__); } \
                                               ^~~~~~~~~~~~~
components/driver/ledc.c:497:25: note: 'glb_clk' was declared here
     ledc_slow_clk_sel_t glb_clk;
                         ^~~~~~~
cc1.exe: some warnings being treated as errors
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 25, 2022
@github-actions github-actions bot changed the title fix glb_clk may be uninitialized build error in ledc driver fix glb_clk may be uninitialized build error in ledc driver (IDFGH-7450) May 25, 2022
@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution.

@dabbinavo
Copy link
Contributor

@suda-morris, @songruo
Any news here? Still an issue in v5.0-rc1.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Resolution: NA Issue resolution is unavailable labels Jan 5, 2023
espressif-bot pushed a commit that referenced this pull request Feb 3, 2023
ilutchenko pushed a commit to ilutchenko/esp-idf that referenced this pull request Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants