diff --git a/gcc/cobol/cdf.y b/gcc/cobol/cdf.y index d50c36c30075b71308d11147a13949491149489e..897cc888b6306455a2b4606ef9762b120d16f90f 100644 --- a/gcc/cobol/cdf.y +++ b/gcc/cobol/cdf.y @@ -651,7 +651,7 @@ replace_by: name_any[a] BY name_any[b] add_whitespace = $b.token != YDF_PSEUDOTEXT; break; default: - errx(EXIT_FAILURE, "%s:%d: logic error on token %s", + cbl_internal_error( "%s:%d: logic error on token %s", __FILE__, __LINE__, keyword_str($a.token)); break; } diff --git a/gcc/cobol/cdf_text.h b/gcc/cobol/cdf_text.h index 143d27d9ae41f1167013472fa5e21c7333d5af2d..1f8386db2786e10812cab8c41424bcf815f2f792 100644 --- a/gcc/cobol/cdf_text.h +++ b/gcc/cobol/cdf_text.h @@ -203,12 +203,12 @@ cdftext::lex_open( const char filename[] ) { if( kid == -1 ) err(EXIT_FAILURE, "failed waiting for pid %d", pid); if( WIFSIGNALED(status) ) { - errx(EXIT_FAILURE, "%s pid %d terminated by %s", + cbl_internal_error( "%s pid %d terminated by %s", filter, kid, strsignal(WTERMSIG(status)) ); } if( WIFEXITED(status) ) { if( (status = WEXITSTATUS(status)) != 0 ) { - errx(EXIT_FAILURE, "%s exited with status %d", + cbl_internal_error( "%s exited with status %d", filter, status); } } diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc index 6f1d833ec854544276f51e373352ea74baea3bde..0bc76a1394a0945a20b04f88f566841ec4b4bb01 100644 --- a/gcc/cobol/cobol1.cc +++ b/gcc/cobol/cobol1.cc @@ -251,12 +251,12 @@ cobol_langhook_handle_option (size_t scode, break; case OPT_preprocess: if( ! preprocess_filter_add(arg) ) { - errx(EXIT_FAILURE, "error: could not execute preprocessor %s", arg); + cbl_internal_error( "error: could not execute preprocessor %s", arg); } return true; case OPT_include: if( ! include_file_add(cobol_include) ) { - errx(EXIT_FAILURE, "error: could not include %s", cobol_include); + cbl_internal_error( "error: could not include %s", cobol_include); } return true; diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc index 0703de0b039e5e51834a14f12189b04828c11fd8..e5912e93b40aa3e9748db69d3f1491641870a748 100644 --- a/gcc/cobol/genapi.cc +++ b/gcc/cobol/genapi.cc @@ -3465,7 +3465,7 @@ parser_leave_file() } if( file_level == 0 && next_program_is_main ) { - errx(EXIT_FAILURE, + cbl_internal_error( "error: -main switch says \"%s\" should contain the" " starting program, but none was found", current_filename.back().c_str()); diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y index f69cf799c48c492cef26ed0398de19fe70d85454..a25a39a2b538d94020d4c4ec81e992fb0f5880e2 100644 --- a/gcc/cobol/parse.y +++ b/gcc/cobol/parse.y @@ -10913,7 +10913,7 @@ constant_index( int token ) { case QUOTES : return 5; case NULLS : return 6; } - errx(EXIT_FAILURE, "%s:%d: no such constant %d", __func__, __LINE__, token); + cbl_internal_error( "%s:%d: no such constant %d", __func__, __LINE__, token); return (size_t)-1; } @@ -10928,7 +10928,7 @@ relop_of(int token) { case GE: return ge_op; case '>': return gt_op; } - errx(EXIT_FAILURE, + cbl_internal_error( "%s:%d: invalid relop token %d", __func__, __LINE__, token); return lt_op; // not reached @@ -10944,7 +10944,7 @@ relop_invert(relop_t op) { case ge_op: return lt_op; case gt_op: return le_op; } - errx(EXIT_FAILURE, "%s:%d: invalid relop_t %d", __func__, __LINE__, op); + cbl_internal_error( "%s:%d: invalid relop_t %d", __func__, __LINE__, op); return relop_t(0); // not reached } @@ -10975,7 +10975,7 @@ token_of(enum relop_t op) { case ge_op: return GE; case gt_op: return '>'; } - errx(EXIT_FAILURE, "%s:%d: invalid relop_t %d", __func__, __LINE__, op); + cbl_internal_error( "%s:%d: invalid relop_t %d", __func__, __LINE__, op); return 0; // not reached } diff --git a/gcc/cobol/parse_util.h b/gcc/cobol/parse_util.h index 2a21d2def0b0933242f5e05100ec43fc57b49033..06a269478af4b20c62eeeede72cfb9b83d4e57f0 100644 --- a/gcc/cobol/parse_util.h +++ b/gcc/cobol/parse_util.h @@ -374,7 +374,7 @@ intrinsic_invalid_parameter( int token, size_t n, cbl_field_t **fields ) { case 'U' : //National case '8' : //UTF-8 default: - errx(EXIT_FAILURE, "%s: invalid function descr type '%c'", + cbl_internal_error( "%s: invalid function descr type '%c'", __func__, descr.types[i]); } diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l index f13fcd3092ca8a44098f57711496b829f56dae4e..54732fdf39e86e04064ce25ff44e0ed6bfb27d1b 100644 --- a/gcc/cobol/scan.l +++ b/gcc/cobol/scan.l @@ -912,7 +912,7 @@ USE({SPC}FOR)? { return USE; } } } - . { errx(EXIT_FAILURE, "failed to parse field level on line %d", yylineno); } + . { cbl_internal_error( "failed to parse field level on line %d", yylineno); } } <field_state>{ diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc index 236547c226fbc703db716dc38912eda4f28c3319..eecc505763ef70a52ca8e7bc4d0ac7b48684677e 100644 --- a/gcc/cobol/symbols.cc +++ b/gcc/cobol/symbols.cc @@ -510,7 +510,7 @@ static bool label_cmp( const cbl_label_t& key, switch( elem.type ) { case LblNone: if(elem.explicit_parent()) { - errx(EXIT_FAILURE, "%s:%d: LblNone '%s' has parent #%zu", + cbl_internal_error( "%s:%d: LblNone '%s' has parent #%zu", __func__, __LINE__, elem.name, elem.parent ); } assert(!elem.explicit_parent()); @@ -2043,7 +2043,7 @@ defined_fwd_cmp( const void *K, const void *E ) { *e=static_cast<const struct symbol_elem_t *>(E); if( k->type != SymField ) { - errx(EXIT_FAILURE, "%s: key must be field", __func__); + cbl_internal_error( "%s: key must be field", __func__); } if( k->type != e->type ) return 1; if( k->program != e->program ) return 1; @@ -3971,7 +3971,7 @@ symbol_label_add( size_t program, cbl_label_t *input ) e->elem.label.line = -e->elem.label.line; // force insertion if( (e = symbol_add(&elem)) == NULL ) { - errx(EXIT_FAILURE, + cbl_internal_error( "%s:%d: could not add '%s'", __func__, __LINE__, label->name); } @@ -4101,7 +4101,7 @@ symbol_special_add( size_t program, struct cbl_special_name_t *special ) struct symbol_elem_t elem = { SymSpecial, program, { .special = *special } }; if( (e = symbol_add(&elem)) == NULL ) { - errx(EXIT_FAILURE, + cbl_internal_error( "%s:%d: could not add '%s'", __func__, __LINE__, special->name); } @@ -4139,7 +4139,7 @@ symbol_section_add( size_t program, struct cbl_section_t *section ) program, { .section = *section } }; if( (e = symbol_add(&elem)) == NULL ) { - errx(EXIT_FAILURE, + cbl_internal_error( "%s:%d: could not add '%s'", __func__, __LINE__, section->name()); } diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc index 18900afddc8755c9c51d25e8f44487be1463a3e9..67668d7f2895e438f047f5692fd7e1c9043be65f 100644 --- a/gcc/cobol/util.cc +++ b/gcc/cobol/util.cc @@ -2016,7 +2016,7 @@ bool cobol_filename( const char *name, ino_t inode ) { for( auto& elem : old_filenames ) { cbl_warning("%6zu %-30s", elem.second, elem.first.c_str()); } - errx(EXIT_FAILURE, "logic error: missing inode for %s", name); + cbl_internal_error( "logic error: missing inode for %s", name); } inode = p->second; assert(inode != 0);