From f9cc0db999e7757d655a66340785b7bf6050ffff Mon Sep 17 00:00:00 2001 From: rjnorman74 Date: Tue, 8 Dec 2020 17:37:42 +0000 Subject: [PATCH] Fix for POINTER --- cobc/ChangeLog | 5 +++++ cobc/codegen.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cobc/ChangeLog b/cobc/ChangeLog index 555705b15..35fa3a893 100644 --- a/cobc/ChangeLog +++ b/cobc/ChangeLog @@ -1,4 +1,9 @@ +2020-12-08 Ron Norman + + * codegen.c: emit 01/77 USAGE POINTER as 'unsigned char * xxx[1]' + so that it is properly aligned for the hardware + 2020-12-07 Simon Sobisch * codegen.c (output_display_fields): prevent bad integer promotion in diff --git a/cobc/codegen.c b/cobc/codegen.c index 0169e8121..a055155f4 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -2007,6 +2007,10 @@ output_local_base_cache (void) } else if (blp->f->index_type == CB_STATIC_INT_INDEX) { output_local ("static int %s%d;", CB_PREFIX_BASE, blp->f->id); + } else if (blp->f->flag_is_pointer + && (blp->f->level == 1 || blp->f->level == 77)) { + output_local ("static unsigned char *%s%d[1];", + CB_PREFIX_BASE, blp->f->id); } else if( !(blp->f->report_flag & COB_REPORT_REF_EMITTED)) { #ifdef HAVE_ATTRIBUTE_ALIGNED output_local ("static cob_u8_t %s%d[%d]%s;",