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

Wrong type comparison in esp_ptr_in_drom() (IDFGH-10632) #11865

Closed
3 tasks done
josesimoes opened this issue Jul 13, 2023 · 1 comment
Closed
3 tasks done

Wrong type comparison in esp_ptr_in_drom() (IDFGH-10632) #11865

josesimoes opened this issue Jul 13, 2023 · 1 comment
Assignees
Labels
Resolution: Duplicate This issue or pull request already exists Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@josesimoes
Copy link
Contributor

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.

IDF version.

v4.4.5

Operating System used.

Windows

How did you build your project?

Command line with CMake

If you are using Windows, please specify command line type.

CMD

What is the expected behavior?

Build should run succesfully.

What is the actual behavior?

Build error comming from setting warning as error.

[build] E:/GitHub/esp-idf/components/soc/include/soc/soc_memory_types.h: In function 'bool esp_ptr_in_drom(const void*)':
[build] E:/GitHub/esp-idf/components/soc/include/soc/soc_memory_types.h:140:25: error: comparison of integer expressions of different signedness: 'intptr_t' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]
[build]      return ((intptr_t)p >= drom_start_addr && (intptr_t)p < SOC_DROM_HIGH);
[build]              ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

Steps to reproduce.

Build project with compiler options -Wall

Build or installation Logs.

No response

More Information.

This can be fixed by changing the declaration of drom_start_addr from uint32_t to int32_t.
Alternatively the cast in line 140 could be changed to (uintptr_t).

@josesimoes josesimoes added the Type: Bug bugs in IDF label Jul 13, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 13, 2023
@github-actions github-actions bot changed the title Wrong type comparison in esp_ptr_in_drom() Wrong type comparison in esp_ptr_in_drom() (IDFGH-10632) Jul 13, 2023
@igrr
Copy link
Member

igrr commented Jul 13, 2023

I'll close this as duplicate of #11653. To get notifications about this issue, please click "subscribe" in the linked issue.

@igrr igrr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Duplicate This issue or pull request already exists Status: Opened Issue is new and removed Status: Opened Issue is new Status: Done Issue is done internally Resolution: Duplicate This issue or pull request already exists labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate This issue or pull request already exists Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants