Post Go back to editing

C-Compiler in Visual DSP++

Perhaps one enginieer  from ad can give an answer.

Do I see this for the C compiler right, if I say, Visual DSP++ in the version 5.1.2 takes the common Misra-Rules into account automatically provided that I don't change this with compiler switches in the command line. Therefore the # pragma diag ()s are required in the header files?

  • Hi,

    Apologies for the delayed response.

    The VisualDSP++ compiler is one of the most comprehensive MISRA-C:2004 compliance checking tools available. The compiler provides command-line switches and diagnostic control pragmas to enable you to achieve MISRA-C:2004 compliance.

    You can suppress all the MISRA rule checking for particular file or function by doing the following:

    #if defined(_MISRA_RULES)
    #pragma diag(push)
    #pragma diag(suppress:misra_rules_all)
    #endif /* _MISRA_RULES */

    void my_function_using_macros(void)
    {
    }

    #if defined(_MISRA_RULES)
    #pragma diag(pop)
    #endif /* _MISRA_RULES */

    We recommend to refer below VDSP help path for more details:

    Help > Contents > Manuals> Software Tools Manual>Blackfin C/C++ Compiler and Library Manual > C/C++ Compiler and Library Manual for Blackfin® Processors > 1 Compiler > C/C++ Compiler Language Extensions > Pragmas > Diagnostic Control Pragmas > Saving or Restoring the Current Behavior of All Diagnostics

    Help > Contents > Manuals> Software Tools Manual>Blackfin C/C++ Compiler and Library Manual > C/C++ Compiler and Library Manual for Blackfin® Processors > 1 Compiler > MISRA-C Compiler > MISRA-C Compliance > Using the Compiler to Achieve Compliance

    Best Regards,
    Santhakumari.K

  • Hi, i'm not often online here, but many thanks for answer. To invoke and understand MISRA takes time, as you know. So see you lateron.