From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10652 invoked by alias); 7 Jul 2005 04:32:30 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 10644 invoked by uid 22791); 7 Jul 2005 04:32:27 -0000 Received: from yosemite.airs.com (HELO yosemite.airs.com) (205.217.158.180) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Thu, 07 Jul 2005 04:32:27 +0000 Received: (qmail 21322 invoked by uid 10); 7 Jul 2005 04:32:25 -0000 Received: (qmail 5260 invoked by uid 500); 7 Jul 2005 04:32:18 -0000 Mail-Followup-To: gcc-help@gcc.gnu.org, neo_in_matrix@msn.com To: "Neo Anderson" Cc: gcc-help@gcc.gnu.org Subject: Re: What is the purpose of 'warning: no newline at end of file'? References: From: Ian Lance Taylor Date: Thu, 07 Jul 2005 04:32:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00062.txt.bz2 "Neo Anderson" writes: > So, what is the purpose of this warning? What possible 'damages' does > this warning protect against? None. Personally, I think the compiler should only issue this warning with -pedantic. > And, what is the 'the behavior'? In this quote: > > The C++ standard says: If a source file that is not empty does not end > > in a newline character, or ends in a newline character immediately > > preceded by a backslash character, the behavior is undefined. (2.1/1) "the behavior" refers to the behavior of the compiler. It means that the standard does not specify how the compiler must behave when it sees a non-empty file which does not end with a newline. Ian