diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index 9e515f87fb1b870f4b8e57bc62f60f5d13d5b0e1..c880ad73375b8ca130906be18efd9b751b90189c 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -4751,7 +4751,7 @@ add_body:       sum TO rnames
                     corresponding_arith_fields( $sum->refers.front().field,
                                                 rhs.front().refer.field );
                     if( pairs.empty() ) {
-                      yywarn( "warning: %s and %s have no corresponding fields",
+                      yywarn( "%s and %s have no corresponding fields",
                                 $sum->refers.front().field->name,
                                 rhs.front().refer.field->name );
                     }
@@ -5166,7 +5166,7 @@ exit:           GOBACK exit_with[status]
         |       EXIT { statement_begin(@1, EXIT); } exit_what
         |       SIMPLE_EXIT
                 {
-                  yyerror( "warning: EXIT was ignored because it is invalid here" );
+                  yyerror( "EXIT was ignored because it is invalid here" );
                 }
                 ;
 		/* Valid "simple" EXIT (Format 1) swallowed by lexer */
@@ -6229,8 +6229,8 @@ move:           MOVE scalar TO move_tgts[tgts]
                   }
 
                   if( !move_corresponding(*$to, *$from) ) {
-                    yywarn( "warning: %s and %s have no corresponding fields",
-                           $from->field->name, $to->field->name );
+                    yywarn( "%s and %s have no corresponding fields",
+                            $from->field->name, $to->field->name );
                   }
                 }
                 ;
@@ -7174,9 +7174,9 @@ subtract_body:  sum FROM rnames
                     corresponding_arith_fields( $sum->refers.front().field,
                                                 rhs.front().refer.field );
                     if( pairs.empty() ) {
-                      yywarn( "warning: %s and %s have no corresponding fields",
-                                $sum->refers.front().field->name,
-                                rhs.front().refer.field->name );
+                      yywarn( "%s and %s have no corresponding fields",
+                               $sum->refers.front().field->name,
+                               rhs.front().refer.field->name );
                     }
                   // First src/tgt elements are templates.
                   // Their subscripts apply to the correspondents.
diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l
index 163e3892300515e387bda8235cf92c29cf3371e3..ee5630b1b537e152591fc3176dcd42545c00ee69 100644
--- a/gcc/cobol/scan.l
+++ b/gcc/cobol/scan.l
@@ -2079,26 +2079,25 @@ BASIS		{ yy_push_state(basis); return BASIS; }
 			yy_set_bol(true);
 			auto top_file = cobol_lineno_save();
 			if( top_file ) {
-			  if( yy_flex_debug ) yywarn("  saving line %4d of %s",
-						    yylineno, top_file);
+			  if( yy_flex_debug ) dbgmsg("  saving line %4d of %s",
+						     yylineno, top_file);
 			}
 			// "\f#file push <name>": name starts at offset 13.
 			char *name = xstrdup(yytext);
-			assert(name != NULL);
 			name[yyleng - 1] = '\0'; // kill the trailing formfeed
 			name += 12;
 			if( yytext[0] != '\f' ) {
-			  yywarn("logic warning: name was adjusted to %s", --name);
+			  dbgmsg("logic warning: name was adjusted to %s", --name);
 			}
 			cobol_filename(name, 0);
 
-			if( yy_flex_debug ) yywarn("starting line %4d of %s",
+			if( yy_flex_debug ) dbgmsg("starting line %4d of %s",
 						  yylineno, name); }
   {POP_FILE} {
 			yy_set_bol(true);
 			auto name = cobol_filename_restore(true);
-	   		if( yy_flex_debug ) yywarn("resuming line %4d of %s",
-						  yylineno, name? name : "<none>"); }
+	   		if( yy_flex_debug ) dbgmsg("resuming line %4d of %s",
+						   yylineno, name? name : "<none>"); }
 
   {LINE_DIRECTIVE} {	cobol_fileline_set(yytext); }
 }
diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc
index 72dc32adb268f15b84fd20981744514a33dc044d..e77e15235b9e671c5f1168f7213823f0378be625 100644
--- a/gcc/cobol/util.cc
+++ b/gcc/cobol/util.cc
@@ -2114,8 +2114,8 @@ verify_format( const char gmsgid[] ) {
   gcc_assert(status == 0);
 
   regmatch_t rm[30];
-  int nmatch = regexec( &re, gmsgid, COUNT_OF(rm), rm, 0 );
-  if( nmatch ) {
+  
+  if( REG_NOMATCH != regexec(&re, gmsgid, COUNT_OF(rm), rm, 0) ){
     fprintf(stderr, "bad diagnositic format: '%s'", gmsgid);
   }
 }