Skip to content

Commit 628ce4e

Browse files
Report error for unsupported LOCAL-STORAGE SECTION (#815)
* fix: report error for unsupported LOCAL-STORAGE SECTION * test: update LOCAL-STORAGE test to expect compilation error
1 parent 775e2ec commit 628ce4e

4 files changed

Lines changed: 1517 additions & 1509 deletions

File tree

cobj/codegen.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,12 +890,17 @@ static void joutput_base(struct cb_field *f) {
890890
bl->next = base_cache;
891891
base_cache = bl;
892892
} else {
893+
/* FIXME: LOCAL-STORAGEのフィールドがbase_cacheに登録されないため、
894+
* JavaのCobolDataStorage宣言に出力されない。
895+
* 以下のC言語スタイルの"unsigned char *"はJavaとして不正。 */
893896
if (current_prog->flag_global_use) {
897+
/* USE GLOBAL宣言がある場合(DECLARATIVESでUSE GLOBAL指定時) */
894898
joutput_local("unsigned char\t\t*%s%s = NULL;", CB_PREFIX_BASE, name);
895899
joutput_local("\t/* %s */\n", top->name);
896900
joutput_local("static unsigned char\t*save_%s%s;\n", CB_PREFIX_BASE,
897901
name);
898902
} else {
903+
/* USE GLOBAL宣言がない場合 */
899904
joutput_local("unsigned char\t*%s%s = NULL;", CB_PREFIX_BASE, name);
900905
joutput_local("\t/* %s */\n", top->name);
901906
}

0 commit comments

Comments
 (0)