Skip to content

[BUG] FreeRTOS v10.5.1 and IAR compiler v9.32.1 causes Remark[Pa091] #757

@rhobison

Description

@rhobison

Compilation with IAR EWARM v9.32.1 causes Remark[Pa091] to be issued.

[ 83%] Building C object rtos_freertos/v10.5.1/Source/CMakeFiles/freertos_kernel.dir/timers.c.o

                  pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_AUTORELOAD );
                                                     ^
"rtos_freertos\v10.5.1\Source\timers.c",465  Remark[Pa091]:
          operator operates on value promoted to int (with possibly unexpected
          result)

              pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
                                                 ^
"rtos_freertos\v10.5.1\Source\timers.c",559  Remark[Pa091]:
          operator operates on value promoted to int (with possibly unexpected
          result)

                                  pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
                                                                     ^
"rtos_freertos\v10.5.1\Source\timers.c",838  Remark[Pa091]:
          operator operates on value promoted to int (with possibly unexpected
          result)

                          pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
                                                             ^
"rtos_freertos\v10.5.1\Source\timers.c",855  Remark[Pa091]: 
          operator operates on value promoted to int (with possibly unexpected
          result)

                                  pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
                                                                     ^
"rtos_freertos\v10.5.1\Source\timers.c",885  Remark[Pa091]:
          operator operates on value promoted to int (with possibly unexpected
          result)

Removing the cast (uint8_t) from the following macros fix the Remarks:

/* Bit definitions used in the ucStatus member of a timer structure. */
    #define tmrSTATUS_IS_ACTIVE                  ( ( uint8_t ) 0x01 )
    #define tmrSTATUS_IS_STATICALLY_ALLOCATED    ( ( uint8_t ) 0x02 )
    #define tmrSTATUS_IS_AUTORELOAD              ( ( uint8_t ) 0x04 ) 

Target

  • Instruction Set Architecture: Arm Cortex-m0
  • Toolchain and version: IAR EWARM v9.32.1

Host

  • Host OS: Windows
  • Version: Win10 21H2

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