Discussion:
warning: no newline at end of file
Iman Mansoori Gowhari
2004-07-12 14:33:13 UTC
Permalink
How can I disable this warning:
"warning: no newline at end of file"
Thanks.
Dave Korn
2004-07-13 13:44:44 UTC
Permalink
-----Original Message-----
From: gcc-owner On Behalf Of Iman Mansoori Gowhari
Sent: 12 July 2004 15:33
To: gcc
Subject: warning: no newline at end of file
"warning: no newline at end of file"
Thanks.
Put a newline at the end of the file.

cheers,
DaveK
--
Can't think of a witty .sigline today....
Dave Korn
2004-07-15 11:22:05 UTC
Permalink
-----Original Message-----
From: gcc-owner On Behalf Of Dave Korn
Sent: 13 July 2004 14:45
-----Original Message-----
From: gcc-owner On Behalf Of Iman Mansoori Gowhari
Sent: 12 July 2004 15:33
To: gcc
Subject: warning: no newline at end of file
"warning: no newline at end of file"
Thanks.
Put a newline at the end of the file.
... Or you could always apply this patch (generated against release 3.3.3,
so may need a little fuzz to fit into whatever version you're using), and
then use the flag -Wno-eof-newline to disable the warning....

[ Note that this patch isn't a submission because I'm fairly sure I'm not
using the correct option-parsing mechanism; I'm sure I should be adding a
case to the switch statement in xxxxx, rather than manually copying a global
in c_common_post_options. Oh, and I didn't update the docs either. Both
these things would need doing properly in a real patch. However, it does
the job in a QUAD fashion. ]

cheers,
DaveK
--
Can't think of a witty .sigline today....
Zack Weinberg
2004-07-16 07:31:45 UTC
Permalink
Post by Dave Korn
... Or you could always apply this patch (generated against release 3.3.3,
so may need a little fuzz to fit into whatever version you're using), and
then use the flag -Wno-eof-newline to disable the warning....
[ Note that this patch isn't a submission because I'm fairly sure I'm not
using the correct option-parsing mechanism; I'm sure I should be adding a
case to the switch statement in xxxxx, rather than manually copying a global
in c_common_post_options. Oh, and I didn't update the docs either. Both
these things would need doing properly in a real patch. However, it does
the job in a QUAD fashion. ]
You want to be editing c.opt, which will give you a new OPT_thingy
enumerator that you can add to the switch statement in c-opts.c. The
code for that switch clause should set the flag in the cpplib options
structure directly (several other such clauses do this already); then
you needn't introduce a new global.

I am of the opinion that, since we don't have a generic fine-grained
warning control mechanism (yet), all user requests for new -W switches
should be honored. Therefore, I'm agreed with your patch in principle.

zw
Dave Korn
2004-07-16 09:23:43 UTC
Permalink
-----Original Message-----
From: Zack Weinberg
Sent: 16 July 2004 08:32
Post by Dave Korn
[ Note that this patch isn't a submission because I'm
fairly sure I'm not
Post by Dave Korn
using the correct option-parsing mechanism; I'm sure I
should be adding a
Post by Dave Korn
case to the switch statement in xxxxx, rather than manually
Heh. Meant to say 'c_common_decode_option', not 'xxxxx', but I forgot to
go back and do the cut'n'paste.
copying a global
Post by Dave Korn
in c_common_post_options. Oh, and I didn't update the docs
either. Both
Post by Dave Korn
these things would need doing properly in a real patch.
However, it does
Post by Dave Korn
the job in a QUAD fashion. ]
You want to be editing c.opt, which will give you a new OPT_thingy
enumerator that you can add to the switch statement in c-opts.c. The
code for that switch clause should set the flag in the cpplib options
structure directly (several other such clauses do this already); then
you needn't introduce a new global.
Gotcha. Waittaminnit! c.opt? What's c.opt? I haven't got that in
3.3.x! LOL. Ok, I see from CVS that it's new. Even more amusingly:

Revision 1.2 / (download) - annotate - [select for diffs] , Sun Jun 1
18:24:08 2003 UTC (13 months, 2 weeks ago) by neil
Branch: MAIN
Changes since 1.1: +2 -0 lines
Diff to previous 1.1 (colored)
* Makefile.in (c-options.c, c-options.h): Parallel make safe.
* c.opt: End in blank line.
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Now that's irony! So, where did this stuff used to live? Ah,
COMMAND_LINE_OPTIONS.
I am of the opinion that, since we don't have a generic fine-grained
warning control mechanism (yet), all user requests for new -W switches
should be honored. Therefore, I'm agreed with your patch in
principle.
zw
Subject to the refactoring described above (and reworking it against HEAD
and adding a docs patch and changelog, of course)? I'd better get a move on
and sort out my paperwork then.

cheers,
DaveK
--
Can't think of a witty .sigline today....
Zack Weinberg
2004-07-16 16:24:03 UTC
Permalink
Post by Dave Korn
Post by Zack Weinberg
I am of the opinion that, since we don't have a generic fine-grained
warning control mechanism (yet), all user requests for new -W switches
should be honored. Therefore, I'm agreed with your patch in
principle.
zw
Subject to the refactoring described above (and reworking it against HEAD
and adding a docs patch and changelog, of course)? I'd better get a move on
and sort out my paperwork then.
Yes. But I'll want to check over the patch you eventually come up
with.

zw

Loading...