[SOLVED] SES v7.32 analyze fails where v7.30 succeeds

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] SES v7.32 analyze fails where v7.30 succeeds

    Using clang-tidy to analyze code is a great feature. Unfortunately, analyze doesn't work on my codebase (a mix of C/C++) when using v7.32. Compared to v7.30, SES v7.32 adds three new switches used to run clang-tidy and modifies one:

    Source Code

    1. // switches added by v7.32
    2. -U__clang__
    3. -U__SEGGER_CC__
    4. -D__GNUC__
    5. // switches modified by v7.32
    6. // v7.30 used -mthread-model single
    7. -Xclang -mthread-model
    8. -Xclang single

    The failure is always in the same header:

    Source Code

    1. // error on line 1723 of header <functional>
    2. template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
    3. const void*
    4. __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT
    5. {
    6. if (__ti == typeid(_Fp)) // <<< error on this line
    7. return &__f_.__target();
    8. return (const void*)0;
    9. }
    10. // console reports the following
    11. '__GNUC__' macro redefined [clang-diagnostic-macro-redefined]
    12. use of typeid requires -frtti [clang-diagnostic-error]
    Display All
    Has anyone else seen this and got ideas for a workaround?

    Thanks,
    -Adam
  • Hello Adam,

    Thank you for your inquiry.
    The GNUC define seems duplicate. We will check if this can be removed again.

    Regarding the error you see. It is possible that an updated clang-tidy reacts differently to the same source.
    As a workaround you can set additional options in project options under Code->Code Analyzer.

    In this case as the error states simply add -frtti.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • HI Nino,

    Options added under Code > Code Analyzer > Analyze Command Options C++ aren't applied to the Analyze command unless a new command is defined in Code > Code Analyzer > Analyze Command.

    I defined a new command that looks much the same as the built-in, removing the macro -D__GNUC__ and adding two new macros (see example below). Analyze is working for me again.


    Thanks,
    -Adam

    Source Code

    1. analyze_command_c_options="-x;c;-std=c11"
    2. analyze_command_cpp_options="-x;c++;-std=c++17;-D__SES_ARM;-D__GNU__;-frtti"
  • Hello Adam,

    Great to hear that you are up and running again.

    This thread will be considered as closed now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.