我用的软件版本是CCS5.5,平台是C2000系列的28335,编译优化等级位-O3。
编译警告内容如下:
Description Resource Path Location Type
#303-D typedef name has already been declared (with same type) …… external location: C:\ti\bios_5_42_01_09\packages\ti\bios\include\tistdtypes.h C/C++ Problem
打开tistdtypes.h文件,发现内部也存在对类型的定义,如下
#ifndef _TI_STD_TYPES
#define _TI_STD_TYPES
/*
* Aliases for standard C types
*/
typedef int Int;
typedef unsigned Uns;
typedef char Char;
/* pointer to null-terminated character sequence */
typedef char *String;
typedef void *Ptr; /* pointer to arbitrary type */
typedef unsigned short Bool; /* boolean */
#endif /* _TI_STD_TYPES */
而在工程的另一个头文件DSP2833x_Device.h中也对相关类型进行了定义,如下
#ifndef DSP28xx_DATA_TYPES
#define DSP28xx_DATA_TYPES
typedef unsigned char uint8;
typedef volatile unsigned char vuint8;
typedef int Int16;
typedef long Int32;
typedef long long Int64;
typedef unsigned int uint16;
typedef volatile int vint16; /**< The volatile 16-bit signed data type. */
typedef volatile unsigned short vuint16; /**< The volatile 16-bit unsigned data type. */
typedef unsigned long uint32;
typedef float Float32;
typedef long double Float64;
typedef unsigned long long uint64;
/**
* The SOCKET data type.
*/
typedef uint16 SOCKET;
#endif
因为实际工程中用的类型都是DSP2833x_Device.h中定义的类型,但工程中使用了DSP/BIOS,所以也包含了tistdtypes.h,我个人猜测应该是这两个文件中的类型定义存在冲突,但不知道怎么解决。