From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 580 invoked by alias); 7 Jul 2005 15:23:06 -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 524 invoked by uid 22791); 7 Jul 2005 15:23:00 -0000 Received: from exprod6og8.obsmtp.com (HELO psmtp.com) (64.18.1.128) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Thu, 07 Jul 2005 15:23:00 +0000 Received: from source ([192.150.11.134]) by exprod6ob8.obsmtp.com ([64.18.5.12]) with SMTP; Thu, 07 Jul 2005 08:22:34 PDT Received: from inner-relay-3.eur.adobe.com (inner-relay-3.adobe.com [192.150.20.198] (may be forged)) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j67FFwBM004458 for ; Thu, 7 Jul 2005 08:15:59 -0700 (PDT) Received: from iplan-mn (iplan-mn.corp.adobe.com [10.32.16.20]) by inner-relay-3.eur.adobe.com (8.12.10/8.12.9) with ESMTP id j67FMWiw020967 for ; Thu, 7 Jul 2005 08:22:32 -0700 (PDT) Received: from iplan-mn (localhost [127.0.0.1]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IJ90081YK1JUL@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Thu, 07 Jul 2005 10:22:31 -0500 (CDT) Received: from mn-eljay-a51m.adobe.com (mn-dhcp-17-28.corp.adobe.com [10.32.17.28]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IJ9008YWK1J8N@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Thu, 07 Jul 2005 10:22:31 -0500 (CDT) Date: Thu, 07 Jul 2005 15:23:00 -0000 From: Eljay Love-Jensen Subject: Re: What is the purpose of 'warning: no newline at end of file'? In-reply-to: To: Neo Anderson , gcc-help@gcc.gnu.org Message-id: <6.2.1.2.2.20050707094616.021c54d0@iplan-mn.corp.adobe.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <6.2.1.2.2.20050707063459.0287d5a0@iplan-mn.corp.adobe.com> X-SW-Source: 2005-07/txt/msg00079.txt.bz2 Hi Neo, >#include "Foo.h" >There is already a newline after it. What does the Standard say? The standard says that if you do not put in a newline at the end of Foo.h, the behavior is undefined. The preprocessor directive #include "Foo.h" *includes* the newline at end-of-line. No preprocessor that I know of puts in EXTRA newlines when it expands the preprocessor directives. Putting in an EXTRA newline when the included file lacks one at the end-of-file is compiler specific (enhancement to standard) behavior. Sincerely, --Eljay