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].
Reproduced in [r3729] of trunk.