Quantcast
Channel: Visual COBOL
Viewing all articles
Browse latest Browse all 5819

Forum Post: RE: comp-5 redefination

$
0
0
In your particular case, there are no implications because you have simply defined three-names for the same data item.  The documentation for error 1168 is:           You have redefined a COMP-5 data item. Porting your code to other environments                might produce inconsistent results. Redefinition that doesn't define exactly the same COMP-5 data item could be non-portable between machines with different memory architecture, such as Intel versus IBM.  Thus, the warning; most of COBOL is portable between machine architectures.  COMP-5 is native machine byte order, which differs between machines.  The redefinition starts at the left-most byte, which might be the high-order byte (IBM) or the low-order byte (Intel).  This won't matter when the definitions are for the same data item description, as in your case.  However, REDEFINES allows for the case of the data items being described differently.  One could argue that the compiler should allow your case without a warning, but the compiler does not normally go to this level of analysis just to suppress a warning.

Viewing all articles
Browse latest Browse all 5819


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>