[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cc-mode adds newlines

From: Benjamin Riefenstahl
Subject: Re: cc-mode adds newlines
Date: 24 Jan 2003 00:35:34 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

The following message is a courtesy copy of an article
that has been posted to gnu.emacs.bug as well.

Hi Luc, Heinrich,

Note that I get this on gnu.emacs.bug, and I haven't seen the original
message so I may be missing something.

> Heinrich Rommerskirchen wrote:
>     cc-mode tries to be smart and adds newlines to a file without
>     informing the user and without any easily found option to suppress
>     it.

In general that's correct behaviour, as C requires its input to be a
vaild text file and in valid text files all lines must have a trailing
line terminator.  Some compilers *will* actually ignore the last line,
if it doesn't have a line terminator.

Same goes for other types of text files.  The behaviour of standard C
functions like fgets() is not well defined on text files that are not
valid with regard to this.  Therefore some programs will fail in this

Was there a reason to want to have invalid C source originally, or was
that just an aesthetic problem?

so long, benny

reply via email to

[Prev in Thread] Current Thread [Next in Thread]