본문 바로가기
WORK/Sotfware

[WARING] typedef name has already been declared

by KANG Stroy 2021. 7. 29.
728x90
728x90

Warning[Pe301]: typedef name has already been declared (with same type)

위와 같은 동작의 IAR 경고는 컴파일상의 문제 입니다. 이럴때는 중복 되는 부분에 다음과 같이 정의를 해 주면 컴파일시 경고가 사라집니다. 

아래와 같이 전처리기를 이용합니다. 

#ifndef __SIGFOX__TYPES
#define __SIGFOX__TYPES

/* Unsigned Type*/
typedef unsigned char       sfx_u8;
typedef unsigned short      sfx_u16;
typedef unsigned long       sfx_u32;
typedef unsigned char       sfx_bool;
/* Signed Type */
typedef signed char         sfx_s8;
typedef signed short        sfx_s16;
typedef signed long         sfx_s32;
/* Custom Types */
typedef unsigned short      sfx_error_t;

#endif 

728x90

댓글