Menu

#518 Incorrect "Value size exceeds data size" warning with floating-insertion

GC 3.x
accepted
nobody
5 - default
2020-07-20
2018-04-17
Edward Hart
No

The "value size exceeds data size" warning does not work with MOVEs to items which are entirely floating-insertion editing. For example:

       program-id. tp.
       data division.
       working-storage section.
       01  ws-pic                         pic $$$.$$.

       Procedure division.
           Move 12.34 to ws-pic.
           Move -12.34 to ws-pic.

Compiling with -Wall gives the warnings

./test.cob:9: warning: value size exceeds data size
./test.cob:9: warning: value is 1234
./test.cob:4: warning: 'ws-pic' defined here as PIC $$$.$$
./test.cob:12: warning: ignoring sign
./test.cob:12: warning: value size exceeds data size
./test.cob:12: warning: value is 1234
./test.cob:4: warning: 'ws-pic' defined here as PIC $$$.$$

Note that it says the value is 1234, not 12.34.

If the PIC is changed to $$$.99, these warnings do not occur.

This bug was found in investigating [7a8e2e4e].

Related

Discussion: 7a8e2e4e

Discussion

  • Edward Hart

    Edward Hart - 2020-07-20
    • labels: floating-insertion, editing --> floating-insertion, editing, messages
    • status: open --> accepted
    • Group: unclassified --> GC 3.x
     
  • Edward Hart

    Edward Hart - 2020-07-20

    Reproduced in [r3729] of trunk.

     

Log in to post a comment.