Menu

#807 DISPLAY of USAGE INDEX item with value x"FFFFFFFF" incorrect

invalid
wont-fix
nobody
None
5 - default
2022-12-14
2022-01-24
No

DISPLAY of INDEX item is not correct.
I set a USAGE INDEX item to X"FFFFFFFF" then did a DISPLAY and a COBDUMP of the item.
DISPLAY shows a value -000000001. COBDUMP correctly shows FFFFFFFF.
INDEX items are not supposed to ever be negative.

I attached a tiny program and the called COBDUMP.
I included the COBDUMP I use because I corrected the problem that the sample program has. In order to properly show hex data with a high order 8 bit, the sample program needs the following change.
05 WS-Buffer-Byte-NUM USAGE BINARY-CHAR UNSIGNED.

Unless I am doing something wrong, this is a little bug with DISPLAY.
I'm on MinGW 3.1.2

Why did I do this? Just because.

Michael

1 Attachments

Discussion

  • Simon Sobisch

    Simon Sobisch - 2022-12-14

    Unless I am doing something wrong, this is a little bug with DISPLAY.

    It isn't a bug, the actual storage of an index is a "hardware oriented storage defined by the implementor" and therefore can also be as signed integer if the compiler sees that as to be hardware oriented.

    You may DISPLAY it to get a clue how it is stored, but the actual relation between the storage in memory and the stored value is undefined by the standard.
    It would be possible to add a dialect option to store index values "not optimal", if this is really needed, but so far I've not seen a case where this is true.

     
  • Simon Sobisch

    Simon Sobisch - 2022-12-14
    • status: open --> wont-fix
    • Group: GC 3.x --> invalid
     

Log in to post a comment.

MongoDB Logo MongoDB