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

How to disable esp-idf 5.0-rc1 -Werror=all flag (IDFGH-8780) #10212

Closed
3 tasks done
stkw0 opened this issue Nov 21, 2022 · 8 comments
Closed
3 tasks done

How to disable esp-idf 5.0-rc1 -Werror=all flag (IDFGH-8780) #10212

stkw0 opened this issue Nov 21, 2022 · 8 comments
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally

Comments

@stkw0
Copy link
Contributor

stkw0 commented Nov 21, 2022

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I updated to esp-idf 5.0-rc1 and I saw that in this last version -Werror=all is enabled. This caused some compilation errors (in our code) that before were treated as warnings. How can this flag be removed? I tried adding "-Wno-error" and "-Wno-error=all" without success. I know that I could manually add -Wno-error= for each type of errors but I would want to avoid this.

I thought that, being this an RC, maybe this was added for testing and wasn't removed later. Was this added on purpose?

BTW the migration guide link on 5.0-rc1 release is broken, it returns a 404

@stkw0 stkw0 changed the title How to disable esp-idf 5.0-rc1-Werror=all flag How to disable esp-idf 5.0-rc1 -Werror=all flag Nov 21, 2022
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 21, 2022
@github-actions github-actions bot changed the title How to disable esp-idf 5.0-rc1 -Werror=all flag How to disable esp-idf 5.0-rc1 -Werror=all flag (IDFGH-8780) Nov 21, 2022
@igrr
Copy link
Member

igrr commented Nov 21, 2022

@stkw0 -Werror=all has been used in IDF for a very long time. For example, here it is in release v3.3. So there hasn't been any recent change regarding this flag.

BTW the migration guide link on 5.0-rc1 release is broken, it returns a 404

Thank you for noticing. Have fixed the link.

@stkw0
Copy link
Contributor Author

stkw0 commented Nov 21, 2022

Then I guess the problem is in some other place. What I can say is that the same code compiles correctly with 5.0-beta1 but not with 5.0-rc1. If needed I can provide a small test case

@stkw0
Copy link
Contributor Author

stkw0 commented Nov 21, 2022

I modified the hello_world example to demonstrate the issue. Seems it only happens when a component is added.
build_test.zip

@igrr
Copy link
Member

igrr commented Nov 21, 2022

You are running into #9511. Please take a look at https://docs.espressif.com/projects/esp-idf/en/v5.0-rc1/esp32/migration-guides/release-5.x/gcc.html#int32-t-and-uint32-t-for-xtensa-compiler for the instructions to migrate your code or work around this warning.

@stkw0
Copy link
Contributor Author

stkw0 commented Nov 22, 2022

The interesting thing is that the GCC version didn't change between 5.0-beta1 and 5.0-rc1, it's the same, 11.2.0.

Also the implicit conversion from a C++ enum class to int that was possible with 5.0-beta1 is not possible anymore with 5.0-rc1. That's what made me think about the -Werror flag, in fact removing it produces the same behavior than with 5.0-beta1.

@igrr
Copy link
Member

igrr commented Nov 22, 2022

The interesting thing is that the GCC version didn't change between 5.0-beta1 and 5.0-rc1, it's the same, 11.2.0.

Correct, the version is the same in these releases. However the toolchain build we had in v5.0-beta1 was still configured with uint32_t == unsigned int. The newer toolchain build in v5.0-rc1 has uint32_t == unsigned long.

The format string type warning for unsigned long != unsigned int mismatch is produced also in the earlier versions of GCC, so that part didn't change.

@stkw0
Copy link
Contributor Author

stkw0 commented Nov 22, 2022

I see,that makes sense, thank you very much.

@stkw0 stkw0 closed this as completed Nov 22, 2022
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Won't Do This will not be worked on and removed Status: Opened Issue is new labels Jun 14, 2023
@apalazzi
Copy link

Hi,

I also have problems when compiling a custom module on my project under Eclipse, where compilation fails because -Werror=all is set.

Note that my issue has nothing to do with #9511 , I just want to disable the Werror=all flag.

ESP-IDV v5.1.5 because newer versions are n ot compatible with the Arduino library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants