[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: cc-mode adds newlines
From:
Alan Mackenzie
Subject:
Re: cc-mode adds newlines
Date:
2004年11月21日 21:47:02 +0000 (GMT)
Hi!
On 2004年11月21日, Richard Stallman wrote:
> An equally valid argument is that of the programmer who hacks through the
> night and sets off a build (which takes several hours to complete), goes
> home for some sleep, then comes back into the office the following
> afternoon. He then finds that the build failed for lack of a final
> newline in one of the files. Then he expostulates "FAQ! Why couldn't
> that stupid editor have put that stupid newline in for me?".
>He should use GCC--then this will never happen.
<OFF TOPIC>
Actually, in my (paid) work, our project got hit recently by a GCC
newlines problem: A string which was sent as a command from one box
along a comms channel to another box had an embedded newline in it. This
was fine and worked. That is, it worked until a mix up with our
proprietory version control system, so that one day we got the source
code with "proprietory" line terminators. It compiled without errors or
warnings. The command string with the proprietory EOL _didn't_ work. It
didn't cause an error message either, since it was still valid syntax
(yes, that's a design bug on our part.) It took us ~40 hours of work to
track it down. :-(
Accepting such strings is a violation of the C++ standard, I think. I'll
need to complain about this to GCC. Possibly, I'll not be the first.
<\OFF TOPIC>
>It would be useful to warn about missing final newlines in C, but Emacs
>should not by default add them blindly.
It's good to get such firm guidance. Thanks. I'll forward this to
Martin (assuming he hasn't got the message some other way), and maybe we
can bring out a CC Mode 5.30.10 with this in it "quite soon".
--
Alan Mackenzie (Munich, Germany)
- Re: cc-mode adds newlines, (continued)
- Re: cc-mode adds newlines , Stefan Monnier, 2004年11月22日
- Re: cc-mode adds newlines , Richard Stallman, 2004年11月23日
- Re: cc-mode adds newlines , Stefan Monnier, 2004年11月23日
- Re: cc-mode adds newlines , Martin Stjernholm, 2004年11月28日
- Re: cc-mode adds newlines , Richard Stallman, 2004年11月29日
- Re: cc-mode adds newlines , Martin Stjernholm, 2004年11月30日
- Re: cc-mode adds newlines , Richard Stallman, 2004年11月30日
- Re: cc-mode adds newlines , Andreas Schwab, 2004年11月21日
- Re: cc-mode adds newlines , Andries Brouwer, 2004年11月21日
- Re: cc-mode adds newlines , Richard Stallman, 2004年11月21日
- Re: cc-mode adds newlines,
Alan Mackenzie <=
- Re: cc-mode adds newlines , Richard Stallman, 2004年11月23日
- Re: cc-mode adds newlines , Richard Stallman, 2004年11月24日
- Re: cc-mode adds newlines , Alan Mackenzie, 2004年11月25日
Re: cc-mode adds newlines , Andries.Brouwer, 2004年11月28日
Re: cc-mode adds newlines , Richard Stallman, 2004年11月30日