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

hal/uart_ll.h: Fix compile with C++ deprecated volatile use (IDFGH-10892) #12093

Closed
wants to merge 1 commit into from

Conversation

nomis
Copy link
Contributor

@nomis nomis commented Aug 17, 2023

These headers no longer work in C++ code with newer versions of GCC:

esp-idf/components/hal/esp32c6/include/hal/uart_ll.h: In function 'void uart_ll_ena_intr_mask(uart_dev_t*, uint32_t)': esp-idf/components/hal/esp32c6/include/hal/uart_ll.h:229:21: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  229 |     hw->int_ena.val |= mask;
      |     ~~~~~~~~~~~~~~~~^~~~~~~
esp-idf/components/hal/esp32c6/include/hal/uart_ll.h: In function 'void uart_ll_disable_intr_mask(uart_dev_t*, uint32_t)':
esp-idf/components/hal/esp32c6/include/hal/uart_ll.h:242:21: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  242 |     hw->int_ena.val &= (~mask);
      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~

These headers no longer work in C++ code with newer versions of GCC:

esp-idf/components/hal/esp32c6/include/hal/uart_ll.h: In function 'void uart_ll_ena_intr_mask(uart_dev_t*, uint32_t)':
esp-idf/components/hal/esp32c6/include/hal/uart_ll.h:229:21: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  229 |     hw->int_ena.val |= mask;
      |     ~~~~~~~~~~~~~~~~^~~~~~~
esp-idf/components/hal/esp32c6/include/hal/uart_ll.h: In function 'void uart_ll_disable_intr_mask(uart_dev_t*, uint32_t)':
esp-idf/components/hal/esp32c6/include/hal/uart_ll.h:242:21: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  242 |     hw->int_ena.val &= (~mask);
      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~
@CLAassistant
Copy link

CLAassistant commented Aug 17, 2023

CLA assistant check
All committers have signed the CLA.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Aug 17, 2023
@github-actions github-actions bot changed the title hal/uart_ll.h: Fix compile with C++ deprecated volatile use hal/uart_ll.h: Fix compile with C++ deprecated volatile use (IDFGH-10892) Aug 17, 2023
@suda-morris
Copy link
Collaborator

sha=62597d47fdcddcaf1e1b256f06e6d0c9f13a2e98

@suda-morris suda-morris added the PR-Sync-Merge Pull request sync as merge commit label Aug 18, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Sep 15, 2023
espressif-bot pushed a commit that referenced this pull request Sep 19, 2023
Merges #12093

fix(ll): remove FLAG_ATTR macro

Such kind of operator overload will not work because C++ thinks such overload is ambiguous and it still prefer the built-in one which accepts and returns integer. Manually force type conversion seems to be unavoidable.
CommanderRedYT pushed a commit to CommanderRedYT/esp-idf that referenced this pull request Sep 24, 2023
Merges espressif#12093

fix(ll): remove FLAG_ATTR macro

Such kind of operator overload will not work because C++ thinks such overload is ambiguous and it still prefer the built-in one which accepts and returns integer. Manually force type conversion seems to be unavoidable.
movsb pushed a commit to movsb/esp-idf that referenced this pull request Dec 1, 2023
Merges espressif#12093

fix(ll): remove FLAG_ATTR macro

Such kind of operator overload will not work because C++ thinks such overload is ambiguous and it still prefer the built-in one which accepts and returns integer. Manually force type conversion seems to be unavoidable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Sync-Merge Pull request sync as merge commit Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants