This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C7X Host emulation support

Hi Sir,

We are trying to build and execute our unit test cases using C7X host emulation guideline provided in below document

Refer to: https://www.ti.com/lit/ug/spruig6i/spruig6i.pdf

We are using mingw64 compiler as mentioned in above guideline. But when we try to build it is showing many type related errors as below.

Looks like the types in mingw compiler is conflicting with the types in c7x types. Please help us to resolve this

Thaks

Jeslin

  • It looks like the source file inszt_cpucache.c mistakenly supplies a definition of int_fast8_t.  Here is one way to get a similar error ...

    C:\examples>type file.c
    #include <stdint.h>
    
    typedef char intf8;
    typedef intf8 int_fast8_t;
    
    extern int_fast8_t test_variable;
    
    C:\examples>gcc -c file.c
    file.c:4:15: error: conflicting types for 'int_fast8_t'
     typedef intf8 int_fast8_t;
                   ^
    In file included from C:/Strawberry/c/lib/gcc/x86_64-w64-mingw32/4.9.2/include/stdint.h:9:0,
                     from file.c:1:
    C:/Strawberry/c/x86_64-w64-mingw32/include/stdint.h:58:21: note: previous declaration of 'int_fast8_t' was here
     typedef signed char int_fast8_t;
    

    Note this example directly includes <stdint.h>, while your code includes <c7x.h>, which eventually includes <stdint.h>.  

    Is this an accurate cut down of the problem?

    Thanks and regards,

    -George

  • Hi George

    Yes this is the problem. It is not only stdint.h types, many other standard library files types from mingw are conflicting with c7x.h types in our source code. How to resolve this issue?

    Thanks

    Jeslin

  • For the contrived example I show in my previous post, the solution is to remove the line ...

    typedef intf8 int_fast8_t;

    Instead, rely on the definition of int_fast8_t that comes from <stdint.h> .  Wouldn't a similar solution work for you?

    Thanks and regards,

    -George

  • Hi George,

    We are not supposed to use the types from the mingw standard library files. We need to use the types from our source code and c7x.h

    Is there any way to ignore mingw standard library types?

    Thanks

    Jeslin

  • Is there any way to ignore mingw standard library types?

    Unfortunately, no.

    Thanks and regards,

    -George