First bugs in gpc-970226 ...

Thu, 27 Feb 1997 12:31:20 +0100 (MET)


Hello again,

sorry, but I overlooked a small, but severe bug in gpc-970226 which made
in impossible to redefine built-in identifiers like "Byte" or "Assign"
in Units - which is especially annoying because GPC does define, but
not yet implement "Assign", so you *must* redefine it.

As a side-effect, another bug vanished, too:  Unexported functions were
visible in the whole file.  Now they have the correct scope.  (: Yes, I
know how this is related to redefinitions of built-in identifiers. ;)

And there was another bug preventing us to initialize variables of a
type which has been previously declared to be "Char" in a Unit or Module.
(Weird, eh?:-)

Below is the patch to make it all work; it's on agnes as well.  I will
upload new binaries this evening, about 23:00 MET.

Till the next bug fix,

    Peter

8< -----------------------------------------------------------------------

--- gpc-970226/gpc-module.c	Thu Feb 27 11:34:07 1997
+++ gpc/gpc-module.c	Thu Feb 27 11:11:48 1997
@@ -1120,10 +1120,10 @@
           store_flags (t, s);
           if (depth == 0)
             {
-              if (IDENTIFIER_GLOBAL_VALUE (t))
-                store_tree (IDENTIFIER_GLOBAL_VALUE (t), s, depth + 1);
-              else if (IDENTIFIER_LOCAL_VALUE (t))
+              if (IDENTIFIER_LOCAL_VALUE (t))
                 store_tree (IDENTIFIER_LOCAL_VALUE (t), s, depth + 1);
+              else if (IDENTIFIER_GLOBAL_VALUE (t))
+                store_tree (IDENTIFIER_GLOBAL_VALUE (t), s, depth + 1);
               else
                 store_tree (IDENTIFIER_LIMBO_VALUE (t), s, depth + 1);
             }
@@ -1388,7 +1388,7 @@
           t = get_identifier (id);
           load_flags (t, s);
           if (depth == 0)
-            IDENTIFIER_GLOBAL_VALUE (t) = load_tree (s, depth + 1);
+            IDENTIFIER_LOCAL_VALUE (t) = load_tree (s, depth + 1);
           break;
         }
 
--- gpc-970226/gpc-typeck.c	Thu Feb 27 11:34:07 1997
+++ gpc/gpc-typeck.c	Thu Feb 27 11:26:33 1997
@@ -5811,6 +5811,9 @@
   /* Handle scalar types, including conversions.  */
 
   if (code == INTEGER_TYPE || code == REAL_TYPE || code == POINTER_TYPE
+#ifdef GPC
+      || code == CHAR_TYPE
+#endif
       || code == ENUMERAL_TYPE || code == COMPLEX_TYPE)
     {
       /* Note that convert_for_assignment calls default_conversion


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es