As far as I know, gcc gives a warning if there is no newline at the end of a file.