From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 184CE3858D28; Tue, 18 Apr 2023 03:03:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 184CE3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681787016; bh=dkasCeqh1TcN0826RXgLCWORbKMPOgCibe1x1LwvuaA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vj67X29+eEQkg7XCO+Hd8Gv0AjeIhtOty7iEd7JCYJ/G6Tfxq0k7T6HTixFfAAtIc eJbEw0EbJ90uTweZ6d/KtTN8Wwhv75Sx+dnkinR/XYRT6/qDzmANupULzeD0f7aX80 aBzAJlV6UCJ8ugvzMNzJzpVtxuvUC+OwGESnSPcY= From: "egallager at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/81745] missing warning with -pedantic when a C file does not end with a newline character [-Wnewline-eof] Date: Tue, 18 Apr 2023 03:03:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 8.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: egallager at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81745 --- Comment #16 from Eric Gallager --- (In reply to Andrew Pinski from comment #15) > (In reply to Vincent Lef=C3=A8vre from comment #14) > > Even though GCC decides to add a newline to the logical file, so that t= he > > missing diagnostic can be regarded as correct, I think that an optional > > warning would be useful for portability. > > https://gcc.gnu.org/legacy-ml/gcc-patches/2007-04/msg00651.html was > > suggesting "add -W(no-)eof-newline". So why hasn't -Wno-eof-newline been > > added? >=20 > Because it was decided the warning was not needed at all so why have an > option to turn it on/off if it was not a good warning. It might not have been *needed*, but some people still might *want* it anyw= ays. I think it's a good warning anyways just for style purposes, even if it isn= 't strictly necessary.=