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]

[fortran,patch] Remove gfc_status and gfc_status_char


Hi all,

Attached patch removes gfc_status() and gfc_status_char() from the front-end. They are wrappers to printf() and putchar(), with the added side effect that gfc_status() translates its format string. They were used for different and unsuitable circumstances :
- in dump-parse-tree.c, to dump the parse tree; I don't think we want to localize this parse tree (actually, that's how I found out about this issue: the .po files generated for internationalisation are huge due to all the dump-parse-tree strings being marked for translation)
- in gfc_handle_module_path_options(), we call gfc_status() and then exit(3), which is equivalent to gfc_fatal_error()
- in scanner.c, for some commented-out debugging code; I've replaced that by calls to printf


For dump_parse_tree.c, I've reworked it to use fprintf(), fputs() and fputc() instead of gfc_status() and gfc_status_char(). I've also changed the way it is called so that it is passed a FILE pointer, which is now stdout making it equivalent to the current behaviour but could be something else. (I think it would be better to have the option create a myfile.f90.parse-tree file.)

Finally, I've renamed the "verbose" member of gfc_option_t into "dump_parse_tree" for clarity; verbose is already the name of the -v option.

Bootstrapped, regtested and tested manually with -fdump-parse-tree on x86_64-linux, OK to commit?

FX


Attachment: dump_parse_tree.ChangeLog
Description: Binary data

Attachment: dump_parse_tree.diff
Description: Binary data



--
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/


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