File flush-statement.patch of Package ftnchek
--- ftnchek/fortran.y.orig 2020-09-11 00:21:59.451596683 +0200
+++ ftnchek/fortran.y 2020-09-11 00:21:35.110976044 +0200
@@ -388,6 +388,7 @@ PRIVATE void clone_defn_ahead(Gsymtab *p
%token tok_EXTENDS
%token tok_EXTERNAL
%token tok_EXIT
+%token tok_FLUSH
%token tok_FORALL
%token tok_FORMAT
%token tok_FUNCTION
@@ -1044,6 +1045,7 @@ io_stmt: read_stmt
}
}
| close_stmt
+ | flush_stmt
| inquire_stmt
| io_positioning_stmt
{
@@ -4672,6 +4674,20 @@ rewind_stmt : rewind_handle unit_id EOS
rewind_handle : tok_REWIND {init_io_ctrl_list();}
;
+/* Fortran 2003 statement */
+flush_stmt : flush_handle unit_id EOS
+ {
+ if( $2.tclass != '*'
+ && is_true(ID_EXPR,$2.TOK_flags)){
+ use_variable(&($2));
+ }
+ record_io_unit_id(&$2);
+ }
+ | flush_handle '(' control_info_list ')' EOS
+ ;
+flush_handle : tok_FLUSH {init_io_ctrl_list();}
+ ;
+
/* 56 */
/* "expr" causes shift/reduce conflict on ')' between
--- ftnchek/keywords.c.orig 2020-09-10 10:42:01.413965648 +0200
+++ ftnchek/keywords.c 2020-09-11 00:28:50.926049841 +0200
@@ -177,6 +177,7 @@ PRIVATE struct {
{"EXIT", tok_EXIT, IK | NP | EK, 0},
{"EXTENDS", tok_EXTENDS, IK | NI | MP | EK, 0},
{"EXTERNAL", tok_EXTERNAL, IK | NP | NI | EK, 0},
+{"FLUSH", tok_FLUSH, IK | EK, 0},
{"FORALL", tok_FORALL, IK | NI | EK | CN, 0},
{"FORMAT", tok_FORMAT, IK | NI | EK | MP | NA, 0},
{"FUNCTION", tok_FUNCTION, NP | NI | EK, 0},