public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/40474]  New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
@ 2009-06-17 11:40 rlerallut at free dot fr
  2009-06-17 11:41 ` [Bug c/40474] " rlerallut at free dot fr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rlerallut at free dot fr @ 2009-06-17 11:40 UTC (permalink / raw)
  To: gcc-bugs

When compiling a C or C++ program with gcc 4.3 (and 4.4), there is no longer a
warning about "no newline at end of file".

I work with people that use gcc 4.2, which emits the warning, and we use
-Werror, so this is a major hindrance for us.

I'm attaching a trivial C program:

$ gcc-4.2 -o newline newline.c
newline.c:4:2: warning: no newline at end of file
$

$ gcc-4.3 -o newline newline.c
$

Versions (all from debian unstable):
gcc-4.2 --version
gcc-4.2 (GCC) 4.2.4 (Debian 4.2.4-6)
gcc-4.3 --version
gcc-4.3 (Debian 4.3.3-11) 4.3.3
gcc-4.4 --version
gcc-4.4 (Debian 4.4.0-6) 4.4.0


Regards,
Romain


-- 
           Summary: gcc 4.3 no longer warns about missing newlines at end of
                    files (regression from 4.2)
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rlerallut at free dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
@ 2009-06-17 11:41 ` rlerallut at free dot fr
  2009-06-17 13:35 ` joseph at codesourcery dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rlerallut at free dot fr @ 2009-06-17 11:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rlerallut at free dot fr  2009-06-17 11:41 -------
Created an attachment (id=18011)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18011&action=view)
Trivial program that does *not* end with a newline

Make sure that your editor does not add silently a newline character to the
file.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
  2009-06-17 11:41 ` [Bug c/40474] " rlerallut at free dot fr
@ 2009-06-17 13:35 ` joseph at codesourcery dot com
  2009-06-17 13:52 ` rlerallut at free dot fr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: joseph at codesourcery dot com @ 2009-06-17 13:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from joseph at codesourcery dot com  2009-06-17 13:35 -------
Subject: Re:   New: gcc 4.3 no longer warns about missing newlines
 at end of files (regression from 4.2)

On Wed, 17 Jun 2009, rlerallut at free dot fr wrote:

> When compiling a C or C++ program with gcc 4.3 (and 4.4), there is no longer a
> warning about "no newline at end of file".

This is deliberate; see bug 14331.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
  2009-06-17 11:41 ` [Bug c/40474] " rlerallut at free dot fr
  2009-06-17 13:35 ` joseph at codesourcery dot com
@ 2009-06-17 13:52 ` rlerallut at free dot fr
  2009-06-17 13:59 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rlerallut at free dot fr @ 2009-06-17 13:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rlerallut at free dot fr  2009-06-17 13:51 -------
(In reply to comment #2)
> This is deliberate; see bug 14331.

Err... What happened to following the standard ?
"
If a source file  that  is  not  empty
      does  not end in a new-line character, or ends in a new-line char-
      acter immediately preceded by a backslash character, the  behavior
      is undefined.
" 
C++ 98, 2.1.2 "Lexical conventions"


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
                   ` (2 preceding siblings ...)
  2009-06-17 13:52 ` rlerallut at free dot fr
@ 2009-06-17 13:59 ` joseph at codesourcery dot com
  2009-06-17 14:15 ` rlerallut at free dot fr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: joseph at codesourcery dot com @ 2009-06-17 13:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from joseph at codesourcery dot com  2009-06-17 13:59 -------
Subject: Re:  gcc 4.3 no longer warns about missing newlines at
 end of files (regression from 4.2)

On Wed, 17 Jun 2009, rlerallut at free dot fr wrote:

> (In reply to comment #2)
> > This is deliberate; see bug 14331.
> 
> Err... What happened to following the standard ?
> "
> If a source file  that  is  not  empty
>       does  not end in a new-line character, or ends in a new-line char-
>       acter immediately preceded by a backslash character, the  behavior
>       is undefined.
> " 

Behavior being undefined means no requirement for a diagnostic, and the 
phase 1 mapping can introduce this newline in any case.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
                   ` (3 preceding siblings ...)
  2009-06-17 13:59 ` joseph at codesourcery dot com
@ 2009-06-17 14:15 ` rlerallut at free dot fr
  2009-06-17 14:28 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rlerallut at free dot fr @ 2009-06-17 14:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rlerallut at free dot fr  2009-06-17 14:15 -------
(In reply to comment #4)
> Behavior being undefined means no requirement for a diagnostic, and the 
> phase 1 mapping can introduce this newline in any case.

Allright, so if I develop my code with gcc 4.3, I have no way of checking for
these missing newlines before sending it to my colleagues that still use gcc
4.2 ?  With Werror activated, it's quite a pain since it breaks builds on their
machines.

And what happened to configuration flags ? 

Why is this change not mentioned in http://gcc.gnu.org/gcc-4.3/changes.html ?
Or here http://gcc.gnu.org/gcc-4.3/porting_to.html ? 

This is not a responsible behavior.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
                   ` (4 preceding siblings ...)
  2009-06-17 14:15 ` rlerallut at free dot fr
@ 2009-06-17 14:28 ` joseph at codesourcery dot com
  2009-06-18 16:43 ` manu at gcc dot gnu dot org
  2009-06-18 18:05 ` rlerallut at free dot fr
  7 siblings, 0 replies; 9+ messages in thread
From: joseph at codesourcery dot com @ 2009-06-17 14:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from joseph at codesourcery dot com  2009-06-17 14:28 -------
Subject: Re:  gcc 4.3 no longer warns about missing newlines at
 end of files (regression from 4.2)

On Wed, 17 Jun 2009, rlerallut at free dot fr wrote:

> And what happened to configuration flags ? 

Configuration flags to change details of warnings are generally a bad 
idea.

> Why is this change not mentioned in http://gcc.gnu.org/gcc-4.3/changes.html ?

That only lists significant changes, not the thousands of minor 
improvements and bug fixes for which you can search Bugzilla.  If the 
person fixing a PR doesn't feel it's significant enough to mention in the 
release notes, it won't be listed there.

> Or here http://gcc.gnu.org/gcc-4.3/porting_to.html ? 

Your concern appears to be porting from 4.3 to 4.2, and that page is about 
porting in the other direction.  We don't write documentation for 
downgrading GCC.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
                   ` (5 preceding siblings ...)
  2009-06-17 14:28 ` joseph at codesourcery dot com
@ 2009-06-18 16:43 ` manu at gcc dot gnu dot org
  2009-06-18 18:05 ` rlerallut at free dot fr
  7 siblings, 0 replies; 9+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-06-18 16:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from manu at gcc dot gnu dot org  2009-06-18 16:43 -------
The warning was removed on purpose per user request, so this is WONTFIX. 

We are sorry about the inconvenience this causes to you. We humbly suggest you
consider using a more modern editor, for example emacs, which will introduce a
newline at the end of the file. Otherwise, your colleagues could perhaps update
to the same version of GCC you are using. Developing with different versions of
GCC is likely to cause some discrepancies because of fixed/new bugs.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/40474] gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2)
  2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
                   ` (6 preceding siblings ...)
  2009-06-18 16:43 ` manu at gcc dot gnu dot org
@ 2009-06-18 18:05 ` rlerallut at free dot fr
  7 siblings, 0 replies; 9+ messages in thread
From: rlerallut at free dot fr @ 2009-06-18 18:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rlerallut at free dot fr  2009-06-18 18:04 -------
(In reply to comment #7)
> The warning was removed on purpose per user request, so this is WONTFIX. 

Keeping an once of compatibility (or adding an option) between two minor
versions would have been appreciated. Or a pragma, whatever. Not all of us have
the luxury of a homogeneous development environment.

> We are sorry about the inconvenience this causes to you. We humbly suggest you
> consider using a more modern editor, for example emacs, which will introduce a
> newline at the end of the file.

So does vim [flamebait right back at you].  However many of my colleagues use
visual c++ which does not have this feature (or not by default). 

> Otherwise, your colleagues could perhaps update
> to the same version of GCC you are using. Developing with different versions of
> GCC is likely to cause some discrepancies because of fixed/new bugs.

Yes. Not to mention the various behavior in floating point optimizations.  Most
of our Linux-using developers use gcc 4.2 on Ubuntu's latest "long term
support" release. But part of my job is to evaluate the compilers we have
available (or will have in the future). I therefore routinely use gcc from 4.1
to 4.4 as well as intel's icc and visual c++.

It's already hard enough being one of the few linux people in a windows shop,
you're not making my task easier.


Well, I guess you can't please everyone all the time. Wontfix it is.
 I'll patch my local copy.


Regards,
Romain


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40474


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-18 18:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 11:40 [Bug c/40474] New: gcc 4.3 no longer warns about missing newlines at end of files (regression from 4.2) rlerallut at free dot fr
2009-06-17 11:41 ` [Bug c/40474] " rlerallut at free dot fr
2009-06-17 13:35 ` joseph at codesourcery dot com
2009-06-17 13:52 ` rlerallut at free dot fr
2009-06-17 13:59 ` joseph at codesourcery dot com
2009-06-17 14:15 ` rlerallut at free dot fr
2009-06-17 14:28 ` joseph at codesourcery dot com
2009-06-18 16:43 ` manu at gcc dot gnu dot org
2009-06-18 18:05 ` rlerallut at free dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).