This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

_Bool and pc_lint

trying to use pc-lint with MISRA 2012 I have tried to change in stdbool

    #define bool _Bool
//typedef _Bool bool;


makes no difference

any suggestions?

I get the below type of 'report' all over the place.

bool bIsFahrenheit = false;
^
..\Src\statemachine.c(34,0): Note 970: Use of modifier or type '_Bool' outside of a typedef [MISRA 2012 Directive 4.6, advisory]

                   ^
..\Src\statemachine.c(34,0): Note 9075: external symbol 'bIsFahrenheit' defined without a prior declaration [MISRA 2012 Rule 8.4, required]

#... ve -e921 */(_Bool) 0/*lint -restore */
                     ^
..\Src\statemachine.c(34,0): Note 970: Use of modifier or type '_Bool' outside of a typedef [MISRA 2012 Directive 4.6, advisory]


Parents
  • You'll have to watch out for other copies of <stdbool.h> lying around in the configured #include path seen by PC-lint,

    there are no stdbool in the project directory
    these are the ones in the keil directory

    C:\keil_v5\ARM\ARMCC\include
    C:\keil_v5\ARM\ARMCLANG\include
    C:\keil_v5\ARM\ARMCLANG\include\libcxx
    C:\keil_v5\ARM\ARMCLANG\lib\clang\5.0.0\include

    this is the includes in the project options
    ../Inc;../Drivers/STM32F0xx_HAL_Driver/Inc;../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F0xx/Include;../Drivers/CMSIS/Include;../Touch-user;../Middleware-touch/inc;../Lcd;..\Images

    it seems the Keil directory links are automsatic
    2) if yes, how do I modify w/o getting compile errors

    computer control string from project options:
    --c99 -c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Inc -I ../Drivers/STM32F0xx_HAL_Driver/Inc -I ../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F0xx/Include -I ../Drivers/CMSIS/Include -I ../Touch-user -I ../Middleware-touch/inc -I ../Lcd -I ../Images
    -I./RTE/_GP_TMO
    -IC:/Keil_v5/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
    -IC:/Keil_v5/ARM/PACK/Keil/STM32F0xx_DFP/1.5.0/Device/Include
    -D__UVISION_VERSION="524" -D_RTE_ -DSTM32F091xC -DUSE_HAL_DRIVER -DSTM32F091xC -DTMO
    -o .\Obj\*.o --omf_browse .\Obj\*.crf --depend .\Obj\*.d

    erik

Reply
  • You'll have to watch out for other copies of <stdbool.h> lying around in the configured #include path seen by PC-lint,

    there are no stdbool in the project directory
    these are the ones in the keil directory

    C:\keil_v5\ARM\ARMCC\include
    C:\keil_v5\ARM\ARMCLANG\include
    C:\keil_v5\ARM\ARMCLANG\include\libcxx
    C:\keil_v5\ARM\ARMCLANG\lib\clang\5.0.0\include

    this is the includes in the project options
    ../Inc;../Drivers/STM32F0xx_HAL_Driver/Inc;../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F0xx/Include;../Drivers/CMSIS/Include;../Touch-user;../Middleware-touch/inc;../Lcd;..\Images

    it seems the Keil directory links are automsatic
    2) if yes, how do I modify w/o getting compile errors

    computer control string from project options:
    --c99 -c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Inc -I ../Drivers/STM32F0xx_HAL_Driver/Inc -I ../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F0xx/Include -I ../Drivers/CMSIS/Include -I ../Touch-user -I ../Middleware-touch/inc -I ../Lcd -I ../Images
    -I./RTE/_GP_TMO
    -IC:/Keil_v5/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
    -IC:/Keil_v5/ARM/PACK/Keil/STM32F0xx_DFP/1.5.0/Device/Include
    -D__UVISION_VERSION="524" -D_RTE_ -DSTM32F091xC -DUSE_HAL_DRIVER -DSTM32F091xC -DTMO
    -o .\Obj\*.o --omf_browse .\Obj\*.crf --depend .\Obj\*.d

    erik

Children