This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: no newline at end of file
- From: Zack Weinberg <zack at codesourcery dot com>
- To: "Dave Korn" <dk at artimi dot com>
- Cc: "'Iman Mansoori Gowhari'" <gowhari at cse dot shirazu dot ac dot ir>, <gcc at gcc dot gnu dot org>
- Date: Fri, 16 Jul 2004 00:31:45 -0700
- Subject: Re: warning: no newline at end of file
- References: <NUTMEGMygyK0469PEXN000008c0@NUTMEG.CAM.ARTIMI.COM>
"Dave Korn" <dk@artimi.com> writes:
> ... 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