This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, fortran] tabs are evil


On Sun, Mar 05, 2006 at 04:12:56PM -0800, Steve Kargl wrote:
> The attached patch issues an error if one uses a 
> tab in a context where a member of the Fortran
> Character Set is expected.  By default gfortran
> will accept a tab as whitespace, which is its
> current behavior.  I have added the -ftabs option.
> For -ftabs, we accept tabs as whitespace, and 
> for -fno-tabs we issue an error.  Note that
> -pedantic and/or -std=f95 will trigger the error.
> Also, note that "-std=f95 -ftabs" accepts tabs
> as whitespaces.
> 
> 
> 2006-03-05  Steven G. Kargl  <kargls@comcast.net>
> 
> 	* gfortran.h: Wrap Copyright line.
> 	(gfc_option_t): add flag_tabs member.
> 	* lang.opt: Update Coyright year.  Add the ftabs.
> 	* scanner.c (gfc_gobble_whitespace): Use flag_tabs.
> 	(load_line): Add seen_comment.  Use it and flag_tabs.
> 	* options.c (gfc_init_options): Initialize flag_tabs.
> 	(gfc_post_options): Adjust flag_tabs depending on -pedantic.
> 	(gfc_handle_option):  Process command-line option -f[no-]tabs
> 
> 
> I just realized that I didn't update gfortran.texi.  I'll
> add a description of the new option before I commit.
> 

Due to the underwhelming comments on the "Tabs are evil" patch,
I will be committing this slightly modified patch.  The
new patch downgrades the severity of a fatal error to a
warning.  IMHO, it should be a fatal error, but I grow
weary of this topic.

2006-03-05  Steven G. Kargl  <kargls@comcast.net>

	* gfortran.h: Wrap Copyright line.
	(gfc_option_t): add warn_tabs member.
	* lang.opt: Update Coyright year.  Add the Wtabs.
	* invoke.texi: Document -Wtabs.
	* scanner.c (gfc_gobble_whitespace): Use warn_tabs.  Add linenum to
	suppress multiple warnings.
	(load_line): Use warn_tabs.  Add linenum, current_line, seen_comment
    to suppress multiple warnings.
	* options.c (gfc_init_options): Initialize warn_tabs.
	(set_Wall): set warn_tabs for -Wall.
	(gfc_post_options): Adjust flag_tabs depending on -pedantic.
	(gfc_handle_option):  Process command-line option -W[no-]tabs

-- 
Steve

Attachment: tabs-new.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]