# HG changeset patch # Parent 4d01a45ef95ea3495b0fd9baa854af6d3d144980 cobol: Fix build on 32-bit Darwin [PR120621] diff --git a/gcc/cobol/lexio.cc b/gcc/cobol/lexio.cc --- a/gcc/cobol/lexio.cc +++ b/gcc/cobol/lexio.cc @@ -1857,7 +1857,7 @@ cdftext::process_file( filespan_t mfile, []( char ch ) { return ch == '\n'; } ); struct { int in, out; filespan_t mfile; } copy; dbgmsg("%s:%d: line " HOST_SIZE_T_PRINT_UNSIGNED ", opening %s on fd %d", - __func__, __LINE__,mfile.lineno(), + __func__, __LINE__, (fmt_size_t)mfile.lineno(), copybook.source(), copybook.current()->fd); copy.in = copybook.current()->fd; copy.mfile = free_form_reference_format( copy.in ); diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y --- a/gcc/cobol/parse.y +++ b/gcc/cobol/parse.y @@ -10213,8 +10213,8 @@ intrinsic: function_udf if( p != NULL ) { auto loc = symbol_field_location(field_index(p->field)); error_msg(loc, "FUNCTION %qs has " - "inconsistent parameter type %zu (%qs)", - keyword_str($1), p - args.data(), name_of(p->field) ); + "inconsistent parameter type %ld (%qs)", + keyword_str($1), (long)(p - args.data()), name_of(p->field) ); YYERROR; } $$ = is_numeric(args[0].field)? diff --git a/gcc/cobol/scan_ante.h b/gcc/cobol/scan_ante.h --- a/gcc/cobol/scan_ante.h +++ b/gcc/cobol/scan_ante.h @@ -149,7 +149,7 @@ numstr_of( const char string[], radix_t } auto nx = std::count_if(input, p, fisdigit); if( 36 < nx ) { - error_msg(yylloc, "significand of %s has more than 36 digits (%zu)", input, nx); + error_msg(yylloc, "significand of %s has more than 36 digits (%ld)", input, (long)nx); return NO_CONDITION; } diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc --- a/gcc/cobol/util.cc +++ b/gcc/cobol/util.cc @@ -902,8 +902,8 @@ cbl_field_t::report_invalid_initial_valu return TOUPPER(ch) == 'E'; } ); if( !has_exponent && data.precision() < pend - p ) { - error_msg(loc, "%s cannot represent VALUE %qs exactly (max %c%zu)", - name, data.initial, '.', pend - p); + error_msg(loc, "%s cannot represent VALUE %qs exactly (max %c%ld)", + name, data.initial, '.', (long)(pend - p)); } } }