This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: SoC fortran procedure pointers
- From: "RamÃn GarcÃa" <ramon dot garcia dot f at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 29 Mar 2007 22:25:11 +0200
- Subject: Re: SoC fortran procedure pointers
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=gdspT9YgPxDt9HZXh2rLErtHXsJQS331z5PD2mEZclF4Ph2qrJvNFlPDlA0XRuiPq/L0hvb8vOEaejd/5adZwqry+jid/9DjyfAxjv76wtaISM9Gond50EuVzFU4pu0fuAx5IA7LYKCEqaGOuzEJyvRLjXLecFwfw8NUHZWM32I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=XVGJ/HphAV9e1gVKCQLl6qEMHYXiXwJ38rGFpIhRPlyhFUlA5cz/HfQO60fESHwz0i8H+BPbnCvkN93zsWUBbo6hLl+bINmu5jmVkxk6dkD9D5HNF9/y+A8hxL7UznIvZ5kKsEOjM9KeAAOu1PhIpCo0lmQoRNctJ59qprLTEyE=
- References: <571f6b510703290032v7ed94d00y156671370191ec56@mail.gmail.com> <daa40b5d0703291037q5c98adc7p9bfc5959bdc11788@mail.gmail.com> <460C06AE.1060101@physik.uni-muenchen.de>
You are right that the formatting of the patch is horrible.
Here it is attached.
Sólo en ../../../../gcc-4.1.2/gcc/fortran/: compile_procedure_ptr.diff
diff -x '*~' -u ./decl.c ../../../../gcc-4.1.2/gcc/fortran/decl.c
--- ./decl.c 2006-11-06 18:18:03.000000000 +0100
+++ ../../../../gcc-4.1.2/gcc/fortran/decl.c 2007-03-26 08:10:46.298296687 +0200
@@ -1699,24 +1699,32 @@
}
m = gfc_match (" type ( %n )", name);
- if (m != MATCH_YES)
- return m;
-
- /* Search for the name but allow the components to be defined later. */
- if (gfc_get_ha_symbol (name, &sym))
- {
- gfc_error ("Type name '%s' at %C is ambiguous", name);
+ if (m == MATCH_YES) {
+ /* Search for the name but allow the components to be defined later. */
+ if (gfc_get_ha_symbol (name, &sym))
+ {
+ gfc_error ("Type name '%s' at %C is ambiguous", name);
+ return MATCH_ERROR;
+ }
+
+ if (sym->attr.flavor != FL_DERIVED
+ && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
- }
-
- if (sym->attr.flavor != FL_DERIVED
- && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE)
- return MATCH_ERROR;
+
+ ts->type = BT_DERIVED;
+ ts->kind = 0;
+ ts->derived = sym;
+ return MATCH_YES;
+ }
- ts->type = BT_DERIVED;
+ m = gfc_match (" procedure ");
+ if (m != MATCH_YES) {
+ return m;
+ }
+ m = gfc_match ("( %n ) ", name);
+ ts->type = BT_PROCEDURE;
ts->kind = 0;
- ts->derived = sym;
-
+ ts->derived = NULL; /* FIXME: in case of match, lookup name in symbol table */
return MATCH_YES;
get_kind:
@@ -2935,7 +2943,6 @@
return MATCH_YES;
}
-
/* Return nonzero if we're currently compiling a contained procedure. */
static int
@@ -2952,6 +2959,7 @@
return 0;
}
+
/* Set the kind of each enumerator. The kind is selected such that it is
interoperable with the corresponding C enumeration type, making
sure that -fshort-enums is honored. */
Sólo en ../../../../gcc-4.1.2/gcc/fortran/: decl.c.match_proc