요즘에 빌드서버를 통해서 CI 작업을 만들고 있는데,
외부에서 가져온 라이브러리를 가져다 사용하면서 생기는 warning 들을 제거하고 있었습니다.

하나하나, #pragma warning push / pop / disable 을 이용해서 제거하고 있는데,
유독 C4505 warning 은 제거가 안되더라구요..

희안한게 push / pop 으로 하면 제거가 안되고, 그냥 #pragma warning disable 구문만 적었을때에는 disable 이 되는 것이었습니다...;

라이브러리에서 발생하는 warning 잡으려다가 제가 작업하는 project 전체에 영향을 받을까봐
(참고로 4505 warning은 안쓰는 함수가 있다는 warning)
최대한 해보려고 이렇게 저렇게 막아보고 있는데 정말 push / pop 으로는 안막히더라구요 =_=;;

disable / default 로도 해보고.. 계속 해봤는데 안되서 구글링을 시도했습니다.

http://support.microsoft.com/kb/947783 


Result

When setting #pragma warning(default:4505) to reset the warning, it would enable C4505 warning for the entire CPP file even though it was disabled previsously.

Cause

This is by design.  The C4505 warning applies to a region of code not to a specific function.  The warning is actually tested for at the end of the compilation unit so selectively disabling ths warning will not work. 

Back to the top

Resolution

By design, this C4505 warning cannot be selectively disabled.

증상은 "#pragma warning(default:4505) 로 warning 을 리셋하려고 할때, 이게 모든 CPP 파일..
심지어는 전에 disable 된 것들까지 모두 enable 시키는 것 같다." 고 합니다. 저도 같은 증상~!!

원인은.. "디자인 때문"
함수 호출에 대한 워닝이라서 컴파일 끝에 테스트 되고, 그로 인해서 selectively disabling 이 동작하지 않는다는 것.

명확하네요.

어쩔 수 없이 해당 프로젝트에서는 C4505를 disable 하는 수밖에...;  다른 방법이 떠오르지 않네요..;;;

Compiling...
cl : Command line error D8003 : missing source filename

위와같은 메시지를 만났습니다.
소스 파일 이름이 그리워..???
3초 생각해보다가.. 구글링 시도!

http://www.windows-tech.info/17/1860b7c3c6ce2b18.php

중간에 이런 글이 나온다

Re: Visual C++ General cl : Command line error D8003 : missing source filename

Viorel. 

From the displayed command line, it probably has an unneeded quotation mark. I would first advise to go to project properties -> C/C++ -> Preprocessor -> Preprocessor Definitions and ensure that Preprocessor Definitions field does not contains unneeded quotation marks and other accidental characters, in both Debug and Release configurations.

Can you check or show us the Preprocessor Definitions field

See also: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2356968&SiteID=1.

See also 로 링크가 보이길래 얼른 눌러봤지만, 링크는 Bad Request 를 보여주기만 할 뿐.. -_-;


그런데 글 내용을 자세히 보니, 


==> 아마도 불필요한 인용부호 ["] 가 있을거다. 속성 -> C/C++ -> Preprocessor -> Preprocessor Definitions 에 가서 Debug와 Release 설정 모두에, 불필요한 인용부호나 오타같은게 있는지 확인해보라


라고 되어있습니다.

열어봤더니.. Additional Include Directories 에 따옴표가 있는......

지우고 다시 해봤습니다.

잘 되네요 ^^

+ Recent posts