Study../Programming
no newline at end of file
Yoons...
2009. 5. 29. 20:54
linux 로 gcc 환경에서 컴파일 해보면 가끔 no newline at end of file 이라는 warning을 발견 할 수 있다네요...
(저도 발견했다가 찾아서 해결하는 방법도 찾은.. )
gcc.gnu.org 에 따르면,
include를 하거나 함수 리턴에 의하여 뒤에 실행되어야 할 내용이 있음에도 불구하고
그것을 종료시켰을때. 일어나는 워닝 이라고 하는데...
(맞게 해석한거 맞어..? ;; )
괜히 (잘못된? ) 불필요한 return 등을 달았을때 발생 하는거 같네요.
(저는 받은 코드에서 return을 제거하니 되더라는. )
아래는 위 사이트에서 한 설명입니다.
> What is the rationale for this warning ? What can break or is it a > standards thing ? Imagine foo.h: blah blah blah<no newline> Now bar.c: #include "foo.h" #include "grill.h" Now imagine a preprocessor that isn't smart enough to put the newline in for you... blah blah blah#include "grill.h" It may not include grill.h.