2014-10-24 2 views
5

헤더 파일에는 링크하는 동안 제목에 오류가있는 다음 코드가 있습니다. 그것이 C 표준에 의해 요구로 번역 단위가 비어있을 때 -pedantic 컴파일경고 : ISO C는 빈 변환 단위를 금지합니다.

#ifndef BOOLEAN_H 
#define BOOLEAN_H 

#ifndef FALSE 
#define FALSE 0 
#endif 

#ifndef TRUE 
#define TRUE !FALSE 
#endif 

#endif 

indicating the error occurs in the line of the last #endif 
+0

어떤 컴파일러를? –

+1

왜 헤더 파일을 컴파일하려고합니까? – mafso

답변

14

gcc는 진단을보고합니다. gcc 행복, 당신은 빈 .c 파일에 더미 typedef를 추가 할 수 있도록하려면

typedef int make_iso_compilers_happy; 

또는

extern int make_iso_compilers_happy; 
+0

완벽하게 고마워했습니다. – IamTrent

관련 문제