Skip to content

[BUG] Increment and decrement of volatile is deprecated #1318

@mathiasgredal

Description

@mathiasgredal

When using FreeRTOS on RP2040 and with C++20 and Pico-SDK, you get a warning that volatile increment and decrement is deprecated:

In function 'void vPortRecursiveLock(BaseType_t, uint32_t, spin_lock_t*, BaseType_t)':
portable/ThirdParty/GCC/RP2040/include/portmacro.h:230:51: warning: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
  230 |                 ucRecursionCountByLock[ ulLockNum ]++;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
portable/ThirdParty/GCC/RP2040/include/portmacro.h:244:50: warning: '--' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
  244 |         if( !--ucRecursionCountByLock[ ulLockNum ] )
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions