[gfortran] PATCH Fix PR 18537
Steve Kargl
sgk@troutmask.apl.washington.edu
Tue Mar 8 21:02:00 GMT 2005
On Tue, Mar 08, 2005 at 09:11:14PM +0100, Tobias Schl?ter wrote:
> Steve Kargl wrote:
> > 2005-03-07 Steven G. Kargl <kargls@comcast.net>
> >
> > PR fortran/18537
> > * gfortran.h (gfc_option_t): Add warn_tabs member.
> > * lang.opt: New option -Wtabs.
> > * invoke.texi: document it; Correctly spell FORTRAN as Fortran.
> > * options.c (gfc_init_options, gfc_post_options, set_Wall,
> > gfc_handle_option): Set it.
> > *scanner.c (load_line): Use it
>
> I'm sorry that I didn't think of this earlier, but this will also give a
> warning, if a tab is inside a character literal constant, IOW in a string, and
> is therefore not ok, as arbitrary characters are allowed there. This warning
> can only be issued during parsing, not scanning, once we know whether we're
> inside a character context or not.
Well, a character literal constant looks like
c = 'Someone<tab>may be here'
so, it is relevantly easy to count the number of single or double
quotes to determine if we are in a character literal constant
to suppress the warning. Yes, I'm aware that we need to count
correctly.
c = 'This isn''t a<tab>warning'
c = "This isn't a<tab>warning"
> expanded in load_line (), so it looks like some reworking is necessary to get
> this warning right, and I don't think it's worth it.
What to you mean? It is not worth issuing a warning? Or, it is not
worth reworking the patch.
--
Steve
More information about the Gcc-patches
mailing list