Menu

check takes way longer with misra addon

F Schwa
2020-03-17
2020-05-22
  • F Schwa

    F Schwa - 2020-03-17

    Hi,

    I am running cppcheck (command line on Linux) on a code base in about 18 seconds. Now I added --addon=misra to the command line and it starts taking 158 minutes.

    Do I need to exclude those folders for the misra addon separately?

    My command looks like this:

    cppcheck \
        --language=c \
        --std=c11 \
        --verbose \
        -D__GNUC__ \
        -DUSE_HAL_DRIVER \
        -DSTM32L471xx \
        -I App/Inc \
        -I Core/Inc \
        -I Drivers/STM32L4xx_HAL_Driver/Inc \
        -I Drivers/CMSIS/Device/ST/STM32L4xx/Include \
        -I Drivers/CMSIS/Include \
        -i Core \
        -i Drivers \
        --error-exitcode=1 \
        --relative-paths \
        --enable=all \
        --addon=misra \ <--- If added, check takes ages
        .
    

    Then in verbose output, I can see a lot of misra-related lines within the Driver folder.

    {"file": "Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h", "linenr": 5202, "column": 40, "severity": "style", "message": "misra violation (use --rule-texts=<file> to get proper output)", "addon": "misra", "errorId": "c2012-11.4", "extra": "Undefined"}
    {"file": "Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h", "linenr": 5316, "column": 34, "severity": "style", "message": "misra violation (use --rule-texts=<file> to get proper output)", "addon": "misra", "errorId": "c2012-11.4", "extra": "Undefined"}
    {"file": "Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h", "linenr": 5316, "column": 34, "severity": "style", "message": "misra violation (use --rule-texts=<file> to get proper output)", "addon": "misra", "errorId": "c2012-11.4", "extra": "Undefined"}
    

    Best regards

     

    Last edit: F Schwa 2020-03-17
  • F Schwa

    F Schwa - 2020-03-17

    Hi,

    weird thing is, if I create a misra.json:

    {
        "script":
            "misra.py",
            "args":
                [
                    "--rule-texts=misra.txt"
                ]
    }
    

    and change the command line to --addon=misra.json, it still takes ages, but if I put a typo in there like --tule-texts=misra.txt or if the misra.txt does not exist, it runs in 18 seconds again.

    Best regards

     

    Last edit: F Schwa 2020-03-17
  • F Schwa

    F Schwa - 2020-05-21

    Seems to work now in CppCheck 2.0. Both runs (with valid misra rules file and without) take approximately the same time now.

     
    • versat

      versat - 2020-05-22

      Great, thanks for the feedback.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.