From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: cc-mode adds newlines Date: Sun, 21 Nov 2004 21:47:02 +0000 (GMT) Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1101075007 6278 80.91.229.6 (21 Nov 2004 22:10:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 21 Nov 2004 22:10:07 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 21 23:09:53 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CVzpU-0002Vl-00 for ; Sun, 21 Nov 2004 23:05:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVzyV-00014j-4P for ged-emacs-devel@m.gmane.org; Sun, 21 Nov 2004 17:14:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CVzyJ-00012H-7k for emacs-devel@gnu.org; Sun, 21 Nov 2004 17:14:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CVzyI-00011y-MU for emacs-devel@gnu.org; Sun, 21 Nov 2004 17:14:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CVzyI-00011u-Fw for emacs-devel@gnu.org; Sun, 21 Nov 2004 17:14:14 -0500 Original-Received: from [193.149.49.134] (helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CVzpE-0005pK-Tt; Sun, 21 Nov 2004 17:04:53 -0500 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id VAA00428; Sun, 21 Nov 2004 21:47:03 GMT X-Sender: root@acm.acm Original-To: Richard Stallman In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30211 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30211 Hi! On Sun, 21 Nov 2004, 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. 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)