gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Problem with pointers


From: Keisuke Nishida
Subject: Re: [open-cobol-list] Problem with pointers
Date: Sun Jul 25 06:04:01 2004
User-agent: Mozilla Thunderbird 0.7 (Windows/20040616)

David Korn wrote:

The redefine allows the pointer to be treated as an integer but
because of byteswapping the two do not have the same representation.
Using COMP-5 for the redefines instead of COMP would fix this problem.
However, this seems to happen hundreds of times throughout the 3 million
lines of Cobol I am trying to port, so it would be nice if the
compiler automatically treated a redefines for a pointer to be COMP-5
rathern than COMP.
Can this be changed?  If not, can you let me know where the change
would have to be made?

Hmm, you could do it by the following patch:

--- cobc/field.c.~1.12.~        2004-03-08 06:47:37.000000000 +0900
+++ cobc/field.c        2004-07-25 21:46:52.000000000 +0900
@@ -298,6 +298,10 @@
   /* validate REDEFINES */
   if (f->redefines)
     {
+      if (f->redefines->usage == CB_USAGE_POINTER
+         && f->usage == CB_USAGE_BINARY)
+       f->usage = CB_USAGE_COMP_5;
+
       /* check OCCURS */
       if (f->redefines->flag_occurs)
cb_warning_x (x, _("the original definition `%s' should not have OCCURS"),

However, I don't think it is a good idea to merge this patch
into open-cobol.

Keisuke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]