본문 바로가기

IT관련

Pro*C 컴파일 에러 make warning: type defaults to 'int' extern sqlcxt

오라클 Pro*C 프로그램을 컴파일할때 아래와 같은 경고(Warning) 문구를 만나는 경우가 있습니다.

사실 정확히는 에러는 아니고 경고라 그냥 넘어가도 됩니다. 경고가 잔뜩 나와서 보기 싫어서 그렇지 실행파일을 만들어지니까요.

 

simple.c:118:8: warning: type defaults to 'int' in declaration of 'sqlcxt' [-Wimplicit-int]
 extern sqlcxt (/*_ void **, unsigned int *,
        ^~~~~~
simple.c:120:8: warning: type defaults to 'int' in declaration of 'sqlcx2t' [-Wimplicit-int]
 extern sqlcx2t(/*_ void **, unsigned int *,
        ^~~~~~~
simple.c:122:8: warning: type defaults to 'int' in declaration of 'sqlbuft' [-Wimplicit-int]
 extern sqlbuft(/*_ void **, char * _*/);
        ^~~~~~~
simple.c:123:8: warning: type defaults to 'int' in declaration of 'sqlgs2t' [-Wimplicit-int]
 extern sqlgs2t(/*_ void **, char * _*/);
        ^~~~~~~
simple.c:124:8: warning: type defaults to 'int' in declaration of 'sqlorat' [-Wimplicit-int]
 extern sqlorat(/*_ void **, unsigned int *, void * _*/);
        ^~~~~~~

 

구글링해보니, Pro*C 가 프리컴파일하면서 함수 선언을 할때 리턴값 int 를 명시해야 하는데, void 로 처리했다나 어쩠다나... 그런식입니다. 더 자세히 설명해놓은 걸 찾지를 못했습니다.

 

여하튼 해결책은 make 파일에서 Precompile 옵션에 "CODE=ANSI_C" 를 넣어주면 됩니다.

 

 

makefile 에 이것만 추가해주고 컴파일해보면 경고메시지 없이 컴파일이 잘 됩니다.

CODE=ANSI 만 써도 되네요. 같은 걸로 인식하는가 봅니다.