gcobol-test bugsuite: 01 LEVEL OCCURS
We have four choices with this instruction
01 TABLE PIC X OCCURS 10.
- We can reject it, per ISO 2014
- We can do it right by default, in violation of ISO 2014
- We can eventually implement a dialect, like GnuCOBOL -ftop-level-occurs-clause=ok
- We can do it wrong.
We chose option 4.
SHOW_PARSE for that instruction yields
( 5 ) parser_symbol_add(): 01 TABLE<FldAlphanumeric> off:0 msiz:0 cap:1 dig:1 rdig:0 attr:0x0 loc:0x4655460 OCCURS:10
With a capacity of 1, but with an occurs of 10, and no parent, I end up allocating one byte but initializing ten bytes to spaces. Think "...ten pounds of sausage in a one-pound can..."