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.

redefinition of "TRUE" and "FALSE" v 3.3

Other Parts Discussed in Thread: CCSTUDIO

I am running Code Composer V 3.3. When I build my project, I get an warning (about 50 times) that there is an incompatible redefinition of the macro "TRUE" and "FALSE" The associated files are not in my project, they are

c:/CCStudio_v3.3/c6700/csl_C672x/dsp/inc/csl_types.h

and

c:/CCStudio_v3.3/bios_5_20_05/packages/ti/bios/include/std.h

In the csl_types.h file, I can use #ifndef, and this eliminates the warnings. However, I cannot use this as a solution because I need a fix that is universal and not local to my system. Is there a way in my project to eliminate this?

  • Hi David,

    Sounds like one of the header files is incorrect with their definition. Can you attach both of them here? I'd like to see which one it is.

    As for a workaround, I'm afraid there isn't one better than what you are already doing (modifying the header file directly). Dorry.

    ki


  • csl_types.h

    #ifndef _CSL_TYPES_H_
    #define _CSL_TYPES_H_

    #include <tistdtypes.h>

    typedef Int16           CSL_Uid;
    typedef Int16           CSL_ModuleId;
    typedef Uint32          CSL_Xio;

    typedef Uint16          CSL_BitMask16;
    typedef Uint32          CSL_BitMask32;

    typedef volatile Uint8  CSL_Reg8;
    typedef volatile Uint16 CSL_Reg16;
    typedef volatile Uint32 CSL_Reg32;

    typedef Int16           CSL_Status;
    typedef Int16           CSL_InstNum;
    typedef Int16           CSL_ChaNum;

    typedef enum {
      CSL_EXCLUSIVE = 0,
      CSL_SHARED    = 1
    } CSL_OpenMode;

    typedef enum {
      CSL_FAIL      = 0,
      CSL_PASS      = 1
    } CSL_Test;


    #define TRUE  ((Bool) 1)
    #define FALSE  ((Bool) 0)

    #ifndef NULL
    #define NULL            (0)
    #endif

    #endif /* _CSL_TYPES_H_ */

     

    *******************************************************************************************************************************

    std.h


    #ifndef STD_

    #include <tistdtypes.h>

    /*
     *  #include <tistdtypes.h> must be before '#define STD_' to be compatible
     *  with older versions of <tistdtypes.h> file which had conditional logic
     *  based on STD_.  This protects against possible include path inconsistencies
     *  where user might find older <tistdtypes.h> before BIOS's <tistdtypes.h>.
     */

    #define STD_


    #ifdef _TMS320C28X
    #define _28_ 1
    #ifdef LARGE_MODEL
    #define _28L_ 1
    #define _28l_ 1         /* deprecated, recommend use _28L_ */
    #endif // LARGE_MODEL
    #endif // _TMS320C28X

    #ifdef _TMS320C5XX
    #define _54_ 1
    #endif

    #ifdef __TMS320C55X__
    #define _55_ 1
    #ifdef __LARGE_MODEL__
    #define _55L_ 1
    #define _55l_ 1         /* deprecated, recommend use _55L_ */
    #endif
    #ifdef __HUGE_MODEL__
    #define _55H_ 1
    #define _VCORE3_ 1
    #endif
    #endif

    #ifdef __TMS320C55X_PLUS_BYTE__
    #define _55_  1
    #define _55H_ 1
    #define _55Pb_ 1
    #define _55P_ 1
    #define _VCORE3_ 1
    #endif // __TMS320C55X_PLUS_BYTE__

    //#ifdef __TMS320C55X_PLUS_WORD__
    //#define _55_  1
    //#define       _55H_ 1
    //#define       _55Pw_ 1
    //#define       _55P_ 1
    //#define _VCORE3_ 1
    //#endif // __TMS320C55X_PLUS_WORD__

    #ifdef _TMS320C6200
    #define _62_ 1
    #define _6x_ 1
    #endif

    #ifdef _TMS320C6400
    #define _64_ 1
    #define _6x_ 1
    #endif

    #ifdef _TMS320C6400_PLUS
    #define _64P_ 1
    #define _6x_ 1
    #endif

    #ifdef _TMS320C6700
    #define _67_ 1
    #define _6x_ 1
    #endif

    #ifdef _TMS320C6700_PLUS
    #define _67P_ 1
    #define _6x_ 1
    #endif

    /*
     *  ======== _TI_ ========
     *  _TI_ is defined for all TI targets
     */
    #if defined(_54_) || defined(_55_) || defined (_6x_) || defined (_28_)
    #define _TI_    1
    #endif

    /*
     *  ======== _FLOAT_ ========
     *  _FLOAT_ is defined for all targets that natively support floating point
     */
    #if defined(_67_) || defined(_67P_)
    #define _FLOAT_ 1
    #endif

    /*
     *  ======== _FIXED_ ========
     *  _FIXED_ is defined for all fixed point target architectures
     */
    #if defined(_54_) || defined(_55_) || defined (_62_) || defined(_64_) || defined(_64P_) || defined (_28_)
    #define _FIXED_ 1
    #endif


    /*
     *  8, 16, 32-bit type definitions
     *
     *  Sm* - 8-bit type
     *  Md* - 16-bit type
     *  Lg* - 32-bit type
     *
     *  *Int - signed type
     *  *Uns - unsigned type
     *  *Bits - unsigned type (bit-maps)
     */
    typedef char SmInt;             /* SMSIZE-bit signed integer */
    typedef short MdInt;            /* MDSIZE-bit signed integer */
    #if defined(_6x_)
    typedef int LgInt;              /* LGSIZE-bit signed integer */
    #else
    typedef long LgInt;             /* LGSIZE-bit signed integer */
    #endif

    typedef unsigned char SmUns;    /* SMSIZE-bit unsigned integer */
    typedef unsigned short MdUns;   /* MDSIZE-bit unsigned integer */
    #if defined(_6x_)
    typedef unsigned LgUns;         /* LGSIZE-bit unsigned integer */
    #else
    typedef unsigned long LgUns;    /* LGSIZE-bit unsigned integer */
    #endif

    typedef unsigned char SmBits;   /* SMSIZE-bit bit string */
    typedef unsigned short MdBits;  /* MDSIZE-bit bit string */
    #if defined(_6x_)
    typedef unsigned LgBits;        /* LGSIZE-bit bit string */
    #else
    typedef unsigned long LgBits;   /* LGSIZE-bit bit string */
    #endif


    typedef long int Long;
    typedef short int Short;
    typedef SmBits Byte;            /* smallest unit of addressable store */

    #define Void void

    /* Arg should be size of Ptr */
    #if defined(_54_) || defined(_6x_)
    typedef Int Arg;
    #elif defined(_55_) || defined(_28_)
    typedef void *Arg;
    #else
    /* Other ISAs not supported */
    #error <std.h> types not supported for this target
    #endif

    typedef Int (*Fxn)();           /* generic function type */

    #if defined(_67_) || defined(_67P_)
    typedef float Float;
    #else
    typedef double Float;
    #endif

    #ifndef NULL
    #define NULL 0
    #endif

    #ifndef TRUE
    #define FALSE ((Bool)0)
    #define TRUE  ((Bool)1)
    #endif

    /*
     * These macros are used to cast 'Arg' types to 'Int' or 'Ptr'.
     * These macros were added for the 55x since Arg is not the same
     * size as Int and Ptr in 55x large model.
     */
    #if defined(_28L_) || defined(_55L_) || defined(_55H_)
    #define ArgToInt(A)     ((Int)((long)(A) & 0xffff))
    #define ArgToPtr(A)     ((Ptr)(A))
    #else
    #define ArgToInt(A)     ((Int)(A))
    #define ArgToPtr(A)     ((Ptr)(A))
    #endif

    #endif /* STD_ */

  • Hi,

    This issue was caused by a combination of older tools and was fixed in newer releases by using a combination of ifndefs that you already mentioned.

    A workaround would be to simply suppress the duplicate warnings using a compiler switch -pds<id>. The file <tistdtypes.h> provided with the C672x CSL mentions that:

    tistdtypes.h said:

     * You may get warnings about duplicate type definitions when using this
     * header file with earlier versions of DSP/BIOS and CSL.
     *
     * You can use the '-pds303' compiler option to suppress these warnings.
     */

    Another attempt would be to have a specific header file that undefines and redefines any previous definitions.

    tistdtypes.h said:

    #if defined (_TI_STD_TYPES) || defined (_STD)
    #undef TRUE
    #undef FALSE
    (...)
    #endif

    Hope this helps,

    Rafael

  • I tried adding -pds303 to the compiler option, but it doesn't seem to be working.  This is what is there before I change anything

     

    -s -os -o3 -i"$(Proj_dir)" -i"..\..\libs\ndk\inc" -i"..\..\libs\ndk\inc\hal" -i"c:\CCStudio_v3.3\c6700\csl_C672x\dsp\inc" -i"c:\CCStudio_v3.3\c6700\csl_C672x_intc\dsp\inc" -i"..\..\libs\common" -i"..\..\libs\diagnostics" -i"..\..\libs\Wavegen" -i"..\..\libs\Flashburn" -i"..\..\includes" -i"..\..\libs\NDK\src\hal\eth_smsc\" -d"P15600" -mi1000 -mv67p

     

    Do I just add it to the beginning of that?


    Thanks

  • Edit from above

     

    I found on the compiler tab of the build options under the diagnostic category where I can add 303 to "Supress Diagnostic <n> (-pds)

    When I do that, it shows above, however, I still get the duplicate messages.


    Any ideas?