Menu

Using a custom platform

versat
2017-01-03
2017-01-11
  • versat

    versat - 2017-01-03

    I have created a custom platform file for my MSP430 projects:
    platform_msp430_eabi_large_datamodel.xml:

    <?xml version="1.0"?>
    <platform>
      <char_bit>8</char_bit>
      <default-sign>signed</default-sign>
      <sizeof>
        <short>2</short>
        <int>2</int>
        <long>4</long>
        <long-long>8</long-long>
        <float>4</float>
        <double>8</double>
        <long-double>8</long-double>
        <pointer>4</pointer>
        <size_t>4</size_t>
        <wchar_t>2</wchar_t>
      </sizeof>
    </platform>
    

    I set it with the following commandline option:
    --platform=platform_msp430_eabi_large_datamodel.xml

    But for every file that cppcheck 1.77 processes it prints "Platform:win64" (older versions did the same)
    Now i'm not sure if the correct platform is set or if the default (Host) platform is set (which would be win64).
    cppcheck doesn't report any error/warning about my platform file, so i would expect that it uses it.

     
  • Daniel Marjamäki

    But for every file that cppcheck 1.77 processes it prints "Platform:win64" (older versions did the same)

    Then it sounds to me that win64 is used instead of your xml file.

    For some reason your --platform seems to be overriden. What cppcheck flags do you use? My first guess is that you use --project to analyse a VS project.

     
  • versat

    versat - 2017-01-09

    I'm not using --project. Here is my commandline that is run from a windows batch file:

    "C:\Program Files\Cppcheck/cppcheck" --enable=all --check-library  --language=c --library=std_enhanced --library=msp430 --library=msp430fr6989 --library=customer_Project  -D__COMPILER_VERSION__=4004005 -D__edg_front_end__=1 -D__EDG_PTRDIFF_TYPE__=int -D__EDG_VERSION__=404 -D__LARGE_CODE_MODEL__=1 -D__LARGE_DATA_MODEL__=1 -D__little_endian__=1 -D__MSP430__=1 -D__MSP430FR6989__ -D__MSP430X__ -D__msp430x__ -D__PTRDIFF_T_TYPE__=int -D__SIZE_T_TYPE__=unsigned -D__STDC__=1 -D__STDC_HOSTED__=1 -D__STDC_VERSION__199901L -D__TI_C99_COMPLEX_ENABLED__=1 -D__TI_COMPILER_VERSION__=4004005 -D__TI_EABI__=1 -D__TI_GNU_ATTRIBUTE_SUPPORT__=1 -D__TI_STRICT_ANSI_MODE__=0 -D__TI_STRICT_FP_MODE__=1 -D__TI_WCHAR_T_BITS__=16 -D__unsigned_chars__=1 -D_INLINE=1 -D_MPU_ENABLE -D_OPTIMIZE_FOR_SPACE=1 -U__ASM_HEADER__ -U__cplusplus -U__GNUC__  -I "E:\customer_Project\source/" -I "E:\customer_Project\source/driverlib/MSP430FR5xx_6xx/" -I "C:\ti_ccs_v6.1.2\ccsv6\ccs_base\msp430\include" -I "C:\ti_ccs_v6.1.2\ccsv6\tools\compiler\ti-cgt-msp430_4.4.5\include"  --inconclusive -v  --platform=platform_msp430_eabi_large_datamodel.xml  --std=c99 --xml --xml-version=2 "E:\customer_Project\source"  2>customer_Project_cppcheck_result.xml
    
     
  • versat

    versat - 2017-01-11

    I've reduced the commandline to the following and still the wrong platform is used (or at least cppcheck reports the wrong platform):

    "C:\Program Files\Cppcheck/cppcheck" --platform=platform_msp430_eabi_large_datamodel.xml -v "E:\sourcecode"
    Checking E:\sourcecode\main.c ...
    Defines:
    Includes:
    Platform:win64
    
     

    Last edit: versat 2017-01-11

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.