------- Comment #19 from dominiq at lps dot ens dot fr  2007-10-31 11:11 -------
Minimal quick and dirty patch (including Tobias' one) that fixes the composite
relational operators:

--- /opt/gcc/_gcc-clean/gcc/fortran/module.c    2007-10-28 21:01:20.000000000
+0100
+++ /opt/gcc/gcc-4.3-work/gcc/fortran/module.c  2007-10-31 11:27:08.000000000
+0100
@@ -1087,7 +1087,8 @@
   for (;;)
     {
       c = module_char ();
-      if (!ISALNUM (c) && c != '_' && c != '-')
+      /* Added '=' for intrinsic operators such as /= or >=.  */
+      if (!ISALNUM (c) && c != '_' && c != '-' && c != '=')
        break;

       *p++ = c;
@@ -1195,6 +1196,11 @@
     case 'X':
     case 'Y':
     case 'Z':
+    /* For intrinsic operators such as /= or >=.  */
+    case '=':
+    case '<':
+    case '>':
+    case '/':
       parse_name (c);
       return ATOM_NAME;

It assumes that parse_name is used to read a valid module. If this is not the
case, it leads to:

Fatal Error: Reading module foo at line 30 column 17: find_enum(): Enum not
found

(checked on a hacked module file, note that it would be more user friendly to
replace 'Enum' by the actual atom_name).

Final note for Toby: making FOX-3.0 fails at m_dom_dom.f90 with:

m_dom_dom.f90:10630.37:

    character(len=getsystemId_len(np, associated(np))) :: c
                                    1
Error: Inquiry function 'associated' at (1) is not permitted in an
initialization expression
...
m_dom_dom.f90:928.37:

    character(len=getnodeName_len(np, associated(np))) :: c
                                    1
Error: Inquiry function 'associated' at (1) is not permitted in an
initialization expression
m_dom_dom.f90:3838.21:

          if (str_vs(np%elExtras%namespaceNodes%nodes(i)%this%elExtras%namespac
                    1
Error: Procedure argument at (1) is local to a PURE procedure and has the
POINTER attribute
m_dom_dom.f90:3848.23:

            if (str_vs(np%elExtras%ownerElement%elExtras%namespaceNodes%nodes(i
                      1
Error: Procedure argument at (1) is local to a PURE procedure and has the
POINTER attribute
Fatal Error: Error count reached limit of 25.

If you think that these errors are buggy, please open a new PR.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33941

Reply via email to