diff --git a/gcc/cobol/ChangeLog b/gcc/cobol/ChangeLog index 27fc6c20c746e25d16d52f1a21676a5891da27cd..b659fd8e97a8b984fcd57a283a0c2bbeef97e063 100644 --- a/gcc/cobol/ChangeLog +++ b/gcc/cobol/ChangeLog @@ -44,4 +44,5 @@ fixed UAT for recursive copybook file warnings convert scan_ante.h to cbl_warning convert scan_post.h to cbl_warning + convert scan.l to cbl_warning diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l index 22f866836be474f3c8cdab8d059d73ac7cc450c2..f13fcd3092ca8a44098f57711496b829f56dae4e 100644 --- a/gcc/cobol/scan.l +++ b/gcc/cobol/scan.l @@ -191,7 +191,7 @@ LINE_DIRECTIVE [#]line{SPC}[[:alnum:]]+{SPC}[""''].+\n return NO_CONDITION; } static int nwarn; - if( !nwarn++ ) warnx("warning: Boolean literals are " + if( !nwarn++ ) cbl_warning("warning: Boolean literals are " "not expected to work correctly"); return NUMSTR; } @@ -2086,7 +2086,7 @@ BASIS { yy_push_state(basis); return BASIS; } yy_set_bol(true); auto top_file = cobol_lineno_save(); if( top_file ) { - if( yy_flex_debug ) warnx(" saving line %4d of %s", + if( yy_flex_debug ) cbl_warning(" saving line %4d of %s", yylineno, top_file); } // "\f#file push <name>": name starts at offset 13. @@ -2098,12 +2098,12 @@ BASIS { yy_push_state(basis); return BASIS; } yywarnv("logic warning: name adjusted to %s", --name); } cobol_filename(name, 0); - if( yy_flex_debug ) warnx("starting line %4d of %s", + if( yy_flex_debug ) cbl_warning("starting line %4d of %s", yylineno, name); } {POP_FILE} { yy_set_bol(true); auto name = cobol_filename_restore(); - if( yy_flex_debug ) warnx("resuming line %4d of %s", + if( yy_flex_debug ) cbl_warning("resuming line %4d of %s", yylineno, name? name : "<none>"); } {LINE_DIRECTIVE} { cobol_fileline_set(yytext); } @@ -2136,7 +2136,7 @@ BASIS { yy_push_state(basis); return BASIS; } int token = keyword_tok(yytext); if( token ) { if(yydebug && YY_START) { - warnx("missed token %s in start condition %d", + cbl_warning("missed token %s in start condition %d", yytext, YY_START); } // Do not return "token" because it may have been excluded @@ -2177,7 +2177,7 @@ BASIS { yy_push_state(basis); return BASIS; } cobol_filename_restore(); parser_leave_file(); - if( yydebug ) warnx("resume parsing '%s'", cobol_filename()); + if( yydebug ) cbl_warning("resume parsing '%s'", cobol_filename()); yy_set_bol(true); }