Jordan Abel said:
So the next obvious question is to ask why it is this way?
I personally think it's one of the most dumb restrictions ever
made. Does it change anything about how the program is compiled?
No! I mean, who cares about blank lines. It's the code which is
important.
Apple also seems to have disabled this in their version of gcc on Mac OS X.
What is your evidence for this claim?
note that this does not mean that it should end with a blank line.
Traditionally, every line of a text file ends in a newline character. I
suspect the editors you are using on OSX provide it. This doesn't mean
there is a blank line
There is a newline at the end of this post [technically a carriage
return and a linefeed, since that's how text-based network protocols
tend to do things.]
Whether a text file includes a proper newline on its last line can
depend on which text editor you used to create it.
Discussion of questionable topicality follows (it's topical in
comp.unix.programmer, but at best marginally so in comp.lang.c).
On Unix-like systems, most or all versions of vi (vi, nvi, vim, etc.)
add a newline automatically. If you edit a file that lacks a trailing
newline, it will add one when you update the file. As far as I know,
it's nearly impossible to create a mal-formed text file with vi.
The behavior of emacs, on the other hand, can be configured by setting
the "require-final-newline" variable. By default, emacs will silently
create a file with no trailing newline. It can also be configured
either to silently add a newline, or to ask what to do. I have the
line
(setq require-final-newline 'ask)
in my $HOME/.emacs file.
Other systems and other editors will have different ways of handling
this.