cobol demo5.cbl /anim /nognt;UNIX:
cobol -a demo5.cblこのプログラムでは、部分参照によってレコード p1 に静的および動的にアクセスします。
cblscan64 -m demo5UNIX:
cobscan64 -m demo5これにより次のレポートが生成されます。
Processing file 'demo5.int' **Unsafe modification of pointer at (file: demo5.cbl, line: 12) Modifier : P1 (file: demo5.cbl, def: 6) Pointer : PTR2-1 (file: demo5.cbl, def: 8) **Unsafe modification of pointer at (file: demo5.cbl, line: 13) Modifier : P1 (file: demo5.cbl, def: 6) Pointer : PTR2-1 (file: demo5.cbl, def: 8) **Unsafe modification of pointer at (file: demo5.cbl, line: 13) Modifier : P1 (file: demo5.cbl, def: 6) Pointer : PTR2-2 (file: demo5.cbl, def: 9) **Unsafe modification of pointer at (file: demo5.cbl, line: 14) Modifier : P1 (file: demo5.cbl, def: 6) Pointer : PTR2-1 (file: demo5.cbl, def: 8) **Unsafe modification of pointer at (file: demo5.cbl, line: 14) Modifier : P1 (file: demo5.cbl, def: 6) Pointer : PTR2-2 (file: demo5.cbl, def: 9) Finished file 'demo5.int' - pointer problems could exist
行 11 の最初の静的な部分参照は、適切な処理として、レポートされていません。一方、行 12 の 2 番目の静的部分参照は ptr2-1 の最初のバイトを上書きするので、違反としてレポートされています。
行 13 と 14 では、構文チェックでコンパイラには変数 refm の中身に関する情報がなく、レコード p1 内のどのポインターでも変更される可能性があります。このため、Scan64 は 2 つのポインター ptr2-1 と ptr2-2 の可能性のある違反をレポートします。