[gfortran] Fix PR13910: old-style variable initialization with gfortran
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sun Aug 29 15:24:00 GMT 2004
Paul Brook wrote:
> Section 5 of the Intel Fortran Language Reference contains a fairly good
> description.
> http://www.intel.com/software/products/compilers/docs/for_lang.htm
:-) I only looked through their overview on language extensions (Appendix F),
and didn't see it mentioned there, so I assumed it wasn't documented. Thanks
for the pointer. It looks like I implemented what that text says, so here's my
patch.
The biggest part is moving the stuff for matching DATA statements from match.c
to decl.c. This seemed logical enough, and I use top_val_list() in the new
function match_oldstyle_init(). This function is called from variable_decl()
if we encounter a slash under the right conditions, and adds the encountered
initializers to the namespace's list of datas, and that's how it works.
Built and tested, ChangeLog below, patch and testcase attached.
- Tobi
2004-08-29 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* decl.c (free_variable, free_value, gfc_free_data, var_list,
var_element, top_var_list, match_data_constant, top_val_list,
gfc_match_data): Move here from match.c.
(match_old_style_init): New function.
(variable_decl): Match old-style initialization.
* expr.c (gfc_get_variable_expr): New function.
* gfortran.h (gfc_get_variable_expr): Add prototype.
* gfortran.texi: Start documentation for supported extensions.
* match.c: Remove the functions moved to decl.c.
* match.h (gfc_match_data): Move prototype to under decl.c.
* symbol.c (gfc_find_sym_tree, gfc_find_symbol): Add/correct
comments.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oldstyle.patch
Type: text/x-patch
Size: 23111 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20040829/612c1cd0/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: oldstyle_1.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20040829/612c1cd0/attachment.f90>
More information about the Fortran
mailing list