aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
AgeCommit message (Collapse)AuthorFilesLines
2008-10-31re PR fortran/35840 (ICE for character expression in I/O specifier)Mikael Morin1-1/+1
2008-10-31 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35840 * expr.c (gfc_reduce_init_expr): New function, containing checking code from gfc_match_init_expr, so that checking can be deferred. (gfc_match_init_expr): Use gfc_reduce_init_expr. * io.c (check_io_constraints): Use gfc_reduce_init_expr instead of checking that the expression is a constant. * match.h (gfc_reduce_init_expr): Prototype added. 2008-10-31 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35840 * gfortran.dg/write_check4.f90: New test. From-SVN: r141497
2008-09-14re PR fortran/35840 (ICE for character expression in I/O specifier)Jerry DeLisle1-5/+8
2008-09-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> Tobias Burnus <burnus@net.b.de> PR fortran/35840 * io.c (match_vtag): Add tag name to error message. (match_out_tag): Cleanup whitespace. (gfc_resolve_dt): Resolve id and async tags. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r140366
2008-09-02re PR fortran/37228 (F2008: Support g0.<d> edit descriptor)Jerry DeLisle1-14/+11
2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37228 * io.c (check_format): Allow specifying precision with g0 format. 2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/37301 PR libfortran/37228 * io/io.h (write_real_g0): Declare new function to handle g0.d format. * io/transfer.c (formatted_transfer_scalar): Use new function. * io/format.c (parse_format_list): Enable g0.d. * io/write.c (write_a_char4): Delete unused var. (set_fnode_default): New function to set the default fnode w, d, and e factored from write_real. (write_real): Use new factored function. (write_real_g0): New function that sets d to that passed by g0.d format specifier and set format to ES. Default values for w and e are used from the new function, set_fnode_default. 2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37228 * gfortran.dg/fmt_g0_4.f08: Revised test. From-SVN: r139886
2008-08-16re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8")Jerry DeLisle1-2/+1
2008-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35863 * io.c (gfc_match_open): Enable UTF-8 in checks. * simplify.c (gfc_simplify_selected_char_kind): Enable iso_10646. From-SVN: r139146
2008-07-29gfortran.h (try): Remove macro.Kaveh R. Ghazi1-11/+11
* gfortran.h (try): Remove macro. Replace try with gfc_try throughout. * array.c: Likewise. * check.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.h: Likewise. * parse.c: Likewise. * parse.h: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-openmp.c: Likewise. * trans-types.c: Likewise. From-SVN: r138226
2008-07-22re PR fortran/29835 (Error message of unknown edit descriptor needs improvement)Daniel Kraft1-7/+20
2008-07-22 Daniel Kraft <d@domob.eu> PR fortran/29835 * io.c (error_element), (format_locus): New static globals. (unexpected_element): Spelled out this message fully. (next_char): Keep track of locus when not MODE_STRING. (next_char_not_space): Remember last parsed element in error_element. (format_lex): Fix two indentation errors. (check_format): Use format_locus and possibly error_element for a slightly better error message on invalid format. (check_format_string): Set format_locus to start of the string expression used as format. 2008-07-22 Daniel Kraft <d@domob.eu> PR fortran/29835 * io/format.c (struct format_data): New member error_element. (unexpected_element): Added '%c' to message. (next_char): Keep track of last parsed character in fmt->error_element. (format_error): If the message is unexpected_element, output the offending character, too. 2008-07-22 Daniel Kraft <d@domob.eu> PR fortran/29835 * gfortran.dg/fmt_error_3.f90: New test. * gfortran.dg/fmt_error_4.f90: New test. * gfortran.dg/fmt_error_5.f90: New test. From-SVN: r138063
2008-07-21fmt_g0_3.f08: Fix typo in expected error message.Ralf Wildenhues1-3/+3
gcc/testsuite/ * gfortran.dg/fmt_g0_3.f08: Fix typo in expected error message. gcc/fortran/ * expr.c (gfc_check_pointer_assign): Fix typo in string. * io.c (check_format): Fix typo in string. Fix comment typos. * parse.c (gfc_global_used): Likewise. * resolve.c (resolve_allocate_expr): Likewise. * symbol.c (gfc_set_default_type): Likewise. * arith.c: Fix typos in comments. * array.c: Likewise. * data.c: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * f95-lang.c: Likewise. * gfortran.h: Likewise. * matchexp.c: Likewise. * module.c: Likewise. * primary.c: Likewise. * scanner.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. * trans.h: Likewise. From-SVN: r138040
2008-07-19gfortran.h (new): Remove macro.Kaveh R. Ghazi1-14/+14
* gfortran.h (new): Remove macro. * array.c (gfc_append_constructor, match_array_list, gfc_match_array_constructor): Likewise. * bbt.c (insert, gfc_insert_bbt): Likewise. * decl.c (var_element, top_var_list, top_val_list, gfc_match_data, get_proc_name): Likewise. * expr.c (gfc_copy_actual_arglist): Likewise. * interface.c (compare_actual_formal, check_new_interface, gfc_add_interface): Likewise. * intrinsic.c gfc_convert_type_warn, gfc_convert_chartype): Likewise. * io.c (match_io_iterator, match_io_list): Likewise. * match.c (match_forall_header): Likewise. * matchexp.c (build_node): Likewise. * module.c (gfc_match_use): Likewise. * scanner.c (load_file): Likewise. * st.c (gfc_append_code): Likewise. * symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols, gfc_commit_symbols): Likewise. * trans-common.c (build_field): Likewise. * trans-decl.c (gfc_finish_var_decl): Likewise. * trans-expr.c (gfc_free_interface_mapping, gfc_get_interface_mapping_charlen, gfc_add_interface_mapping, gfc_finish_interface_mapping, gfc_apply_interface_mapping_to_expr): Likewise. * trans.h (gfc_interface_sym_mapping): Likewise. From-SVN: r137982
2008-07-14re PR fortran/36725 (g0 edit descriptor: Missing compile-time checking for ↵Jerry DeLisle1-3/+14
invalid g0.d) 2008-07-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/36725 * io.c: Add error check for g0 edit descriptor followed by '.'. From-SVN: r137769
2008-06-20arith.c (hollerith2representation): Fix for -Wc++-compat.Kaveh R. Ghazi1-6/+6
* arith.c (hollerith2representation): Fix for -Wc++-compat. * array.c (gfc_get_constructor): Likewise. * decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data, create_enum_history, gfc_match_final_decl): Likewise. * error.c (error_char): Likewise. * expr.c (gfc_get_expr, gfc_copy_expr): Likewise. * gfortran.h (gfc_get_charlen, gfc_get_array_spec, gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist, gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface, gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref, gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator, gfc_get_alloc, gfc_get_wide_string): Likewise. * interface.c (count_types_test): Likewise. * intrinsic.c (add_char_conversions, gfc_intrinsic_init_1): Likewise. * io.c (gfc_match_open, gfc_match_close, match_filepos, match_io, gfc_match_inquire, gfc_match_wait): Likewise. * match.c (gfc_match, match_forall_iterator): Likewise. * module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup, add_true_name, parse_string, write_atom, quote_string, mio_symtree_ref, mio_gmp_real, write_common_0): Likewise. * options.c (gfc_post_options): Likewise. * primary.c (match_integer_constant, match_hollerith_constant, match_boz_constant, match_real_constant, gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise. * scanner.c (gfc_widechar_to_char, add_path_to_list, add_file_change, load_line, get_file, preprocessor_line, load_file, unescape_filename, gfc_read_orig_filename): Likewise. * simplify.c (gfc_simplify_ibits, gfc_simplify_ishft, gfc_simplify_ishftc): Likewise. * symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree, gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol): Likewise. * target-memory.c (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. * trans-expr.c (gfc_add_interface_mapping): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_conversion, gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function, gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify, gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise. * trans.c (gfc_get_backend_locus): Likewise. * trans.h (gfc_get_ss): Likewise. From-SVN: r136982
2008-06-07PR fortran/36420, 36422Jerry DeLisle1-1/+19
2008-06-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/36420, 36422 * io.c (check_format): Add new error message for zero width. Use new error message for FMT_A and with READ, FMT_G. Allow FMT_G with WRITE except when -std=F95 and -std=F2003. From-SVN: r136544
2008-05-06arith.c: (gfc_arith_concat...Francois-Xavier Coudert1-35/+49
* arith.c: (gfc_arith_concat, gfc_compare_string, gfc_compare_with_Cstring, hollerith2representation, gfc_hollerith2int, gfc_hollerith2real, gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical): Use wide characters for character constants. * data.c (create_character_intializer): Likewise. * decl.c (gfc_set_constant_character_len): Likewise. * dump-parse-tree.c (show_char_const): Correctly dump wide character strings. error.c (print_wide_char): Rename into gfc_print_wide_char. (show_locus): Adapt to new prototype of gfc_print_wide_char. expr.c (free_expr0): Representation is now disjunct from character string value, so we always free it. (gfc_copy_expr, find_substring_ref, gfc_simplify_expr): Adapt to wide character strings. * gfortran.h (gfc_expr): Make value.character.string a wide string. (gfc_wide_toupper, gfc_wide_strncasecmp, gfc_wide_memset, gfc_widechar_to_char, gfc_char_to_widechar): New prototypes. (gfc_get_wide_string): New macro. (gfc_print_wide_char): New prototype. * io.c (format_string): Make a wide string. (next_char, gfc_match_format, compare_to_allowed_values, gfc_match_open): Deal with wide strings. * module.c (mio_expr): Convert between wide strings and ASCII ones. * primary.c (match_hollerith_constant, match_charkind_name): Handle wide strings. * resolve.c (build_default_init_expr): Likewise. * scanner.c (gfc_wide_toupper, gfc_wide_memset, gfc_char_to_widechar): New functions. (wide_strchr, gfc_widechar_to_char, gfc_wide_strncasecmp): Changes in prototypes. (gfc_define_undef_line, load_line, preprocessor_line, include_line, load_file, gfc_read_orig_filename): Handle wide strings. * simplify.c (gfc_simplify_achar, gfc_simplify_adjustl, gfc_simplify_adjustr, gfc_simplify_char, gfc_simplify_iachar, gfc_simplify_ichar, simplify_min_max, gfc_simplify_new_line, gfc_simplify_repeat): Handle wide strings. (wide_strspn, wide_strcspn): New helper functions. (gfc_simplify_scan, gfc_simplify_trim, gfc_simplify_verify): Handle wide strings. * symbol.c (generate_isocbinding_symbol): Likewise. * target-memory.c (size_character, gfc_target_expr_size, encode_character, gfc_target_encode_expr, gfc_interpret_character, gfc_target_interpret_expr): Handle wide strings. * trans-const.c (gfc_conv_string_init): Lower wide strings to narrow ones. (gfc_conv_constant_to_tree): Likewise. * trans-expr.c (gfc_conv_substring_expr): Handle wide strings. * trans-io.c (gfc_new_nml_name_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign): Likewise. From-SVN: r135006
2008-05-06openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and gfc_peek_ascii_char.Francois-Xavier Coudert1-13/+6
* openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and gfc_peek_ascii_char. * decl.c (gfc_match_kind_spec, gfc_match_type_spec, gfc_match_implicit_none, match_implicit_range, gfc_match_implicit, match_string_p, match_attr_spec, gfc_match_suffix, match_procedure_decl, gfc_match_entry, gfc_match_subroutine): Likewise. * gfortran.h (gfc_char_t): New type. (gfc_linebuf): Make line member a gfc_char_t. (locus): Make nextc member a gfc_char_t. (gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte, gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char, gfc_peek_ascii_char, gfc_check_digit): New prototypes. * error.c (print_wide_char): New function. (show_locus): Use print_wide_char and gfc_wide_strlen. * io.c (next_char): Use gfc_char_t type. (match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char. * match.c (gfc_match_parens, gfc_match_eos, gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C, gfc_match_intrinsic_op, gfc_match_char, gfc_match_return, gfc_match_common): Likewise. * match.h (gfc_match_special_char): Change prototype. * parse.c (decode_specification_statement, decode_statement, decode_omp_directive, next_free, next_fixed): Use gfc_peek_ascii_char and gfc_next_ascii_char. * primary.c (gfc_check_digit): Change name. (match_digits, match_hollerith_constant, match_boz_constant, match_real_constant, next_string_char, match_charkind_name, match_string_constant, match_logical_constant_string, match_complex_constant, match_actual_arg, match_varspec, gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and gfc_next_ascii_char. * scanner.c (gfc_wide_fits_in_byte, wide_is_ascii, gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit, gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy, wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp, gfc_next_ascii_char, gfc_peek_ascii_char): New functions. (next_char, gfc_define_undef_line, skip_free_comments, gfc_next_char_literal, gfc_next_char, gfc_peek_char, gfc_error_recovery, load_line, preprocessor_line, include_line, load_file, gfc_read_orig_filename): Use gfc_char_t for source characters and the {gfc_,}wide_* functions to manipulate wide strings. From-SVN: r134992
2008-05-03re PR fortran/33268 (read ('(f3.3)'), a rejected due to the extra (...))Jerry DeLisle1-14/+57
2008-05-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/33268 * gfortran.h: Add extra_comma pointer to gfc_dt structure. Add iokind to gfc_expr value union. Add io_kind enum to here from io.c. * io.c (gfc_free_dt): Free extra_comma. (gfc_resolve_dt): If an extra comma was encountered and io_unit is type BT_CHARACTER, resolve to format_expr and set default unit. Error if io_kind is M_WRITE. (match_io): Match the extra comma and set new pointer, extra_comma. From-SVN: r134900
2008-04-07PR fortran/25829 28655Jerry DeLisle1-35/+68
2008-04-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25829 28655 * io.c (io_tag): Add new tags for decimal, encoding, asynchronous, round, sign, and id. (match_open_element): Match new tags. (gfc_resolve_open): Resolve new tags. (gfc_match_open): Enable encoding for DEFAULT only. Update error messages. (match_dt_element): Fix match tag for asynchronous. Update error messages. (gfc_free_inquire): Free new expressions. (match_inquire_element): Match new tags. (gfc_match_inquire): Add constraint for ID and PENDING. (gfc_resolve_inquire): Resolve new tags. * trans-io.c (gfc_trans_inquire): Clean up whitespace and fix setting of mask for ID parameter. * ioparm.def: Fix order of parameters for pending, round, and sign. NOTE: These must line up with the definitions in libgfortran/io/io.h. or things don't work. From-SVN: r133989
2008-04-06re PR fortran/35832 (Better error message for wrong arguments to I/O statements)Tobias Schlüter1-58/+81
2008-04-06 Tobias Schlter <tobi@gcc.gnu.org> PR fortran/35832 fortran/ * io.c (io_tag): Add field 'value'. Split 'spec' field in existing io_tags. (match_etag, match_vtag, match_ltag): Split parsing in two steps to give better error messages. testsuite/ * gfortran.dg/io_constraints_2.f90: Adapt to new error message. From-SVN: r133964
2008-04-06io.c (check_io_constraints): Add constrains.Tobias Burnus1-3/+10
2008-04-06 Tobias Burnus <burnus@net-b.de> * io.c (check_io_constraints): Add constrains. ID= requires asynchronous= and asynchronous= must be init expression. 2008-04-06 Tobias Burnus <burnus@net-b.de> * gfortran.dg/f2003_io_1.f03: Make standard conform. * gfortran.dg/f2003_io_8.f03: New. From-SVN: r133962
2008-04-05PR fortran/25829 28655Jerry DeLisle1-76/+498
2008-04-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/25829 28655 * dump-parse-tree.c (gfc_show_code_node): Show new I/O parameters. * gfortran.h (gfc_statement): Add ST_WAIT enumerator. (gfc_open): Add pointers for decimal, encoding, round, sign, asynchronous. (gfc_inquire): Add pointers for asynchronous, decimal, encoding, pending, round, sign, size, id. (gfc_wait): New typedef struct. (gfc_dt): Add pointers for id, pos, asynchronous, blank, decimal, delim, pad, round, sign. (gfc_exec_op): Add EXEC_WAIT enumerator. (gfc_code): Add pointer for wait. (gfc_free_wait), (gfc_resolve_wait): New function prototypes. * trans-stmt.h (gfc_trans_wait): New function prototype. * trans.c (gfc_trans_code): Add case for EXEC_WAIT. * io.c (io_tag): Add new tags for DECIMAL, ENCODING, ROUND, SIGN, ASYCHRONOUS, ID. (match_open_element): Add matchers for new tags. (gfc_free_open): Free new pointers. (gfc_resolve_open): Resolve new tags. (gfc_resolve_open): Remove comment around check for allowed values and ASYNCHRONOUS, update it. Likewise for DECIMAL, ENCODING, ROUND, and SIGN. (match_dt_element): Add matching for new tags. (gfc_free_wait): New function. (gfc_resolve_wait): New function. (match_wait_element): New function. (gfc_match_wait): New function. * resolve.c (gfc_resolve_blocks): Add case for EXEC_WAIT. (resolve_code): Add case for EXEC_WAIT. * st.c (gfc_free_statement): Add case for EXEC_WAIT. * trans-io.c (ioparam_type): Add IOPARM_ptype_wait. (gfc_st_parameter): Add "wait" entry. (iocall): Add IOCALL_WAIT enumerator. (gfc_build_io_library_fndecls): Add function declaration for st_wait. (gfc_trans_open): Add mask bits for new I/O tags. (gfc_trans_inquire): Add mask bits for new I/O tags. (gfc_trans_wait): New translation function. (build_dt): Add mask bits for new I/O tags. * match.c (gfc_match_if) Add matcher for "wait". * match.h (gfc_match_wait): Prototype for new function. * ioparm.def: Add new I/O parameter definitions. * parse.c (decode_statement): Add match for "wait" statement. (next_statement): Add case for ST_WAIT. (gfc_ascii_statement): Same. Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> From-SVN: r133944
2008-02-24arith.c: Update copyright years.Tobias Schlüter1-1/+1
* arith.c: Update copyright years. * arith.h: Likewise. * array.c: Likewise. * bbt.c: Likewise. * check.c: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * dependency.h: Likewise. * dump-parse-tree.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * gfc-internals.texi: Likewise. * gfortran.h: Likewise. * gfortran.texi: Likewise. * gfortranspec.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * intrinsic.texi: Likewise. * invoke.texi: Likewise. * io.c: Likewise. * iresolve.c: Likewise. * iso-c-binding.def: Likewise. * iso-fortran-env.def: Likewise. * lang-specs.h: Likewise. * lang.opt: Likewise. * libgfortran.h: Likewise. * match.c: Likewise. * match.h: Likewise. * matchexp.c: Likewise. * misc.c: Likewise. * module.c: Likewise. * openmp.c: Likewise. * options.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * st.c: Likewise. * symbol.c: Likewise. * target-memory.c: Likewise. * target-memory.h: Likewise. * trans-array.h: Likewise. * trans-const.h: Likewise. * trans-stmt.h: Likewise. * trans-types.c: Likewise. * trans-types.h: Likewise. * types.def: Likewise. From-SVN: r132600
2008-01-06re PR fortran/34654 (no unformatted on internal file)Tobias Burnus1-0/+5
2008-01-06 Tobias Burnus <burnus@net-b.de> PR fortran/34654 * io.c (check_io_constraints): Disallow unformatted I/O for internal units. 2008-01-06 Tobias Burnus <burnus@net-b.de> PR fortran/34654 * gfortran.dg/internal_io_unf.f90: New. From-SVN: r131350
2007-11-17re PR fortran/34108 (ICE: Segmentation fault occurs by "write(*,0)" statement)Francois-Xavier Coudert1-2/+6
PR fortran/34108 * io.c (check_format_string): Only check character expressions. (match_dt_format): Return MATCH_ERROR if that is what gfc_match_st_label said. * gfortran.dg/fmt_label_1.f90: New test. From-SVN: r130249
2007-09-24re PR fortran/33269 (Diagnose missing "(" in "PRINT ('a'),")Tobias Schlüter1-2/+5
PR fortran/33269 fortran/ * io.c (check_format_string): Move NULL and constant checks into this function. (check_io_constraints): Call gfc_simplify_expr() before calling check_format_string(). Remove NULL and constant checks. testsuite/ * gfortran.dg/fmt_error_2.f90: New. From-SVN: r128732
2007-09-20io.c (resolve_tag_format): New function using code split out and simplified ↵Tobias Schlüter1-108/+92
from ... fortran/ * io.c (resolve_tag_format): New function using code split out and simplified from ... (resolve_tag): ... this function. Simplify logic. Unify IOSTAT, IOLENGTH and SIZE handling. testsuite/ * gfortran.dg/g77/19981216-0.f: Remove dg-warning annotation. * gfortran.dg/io_constraints_1.f90: Make a -std=f95 test. Add warning annotation. * gfortran.dg/iostat_3.f90: Make a -std=f95 test. From-SVN: r128623
2007-08-31re PR fortran/33232 (Diagnose comma in "read()," and "write(),")Tobias Burnus1-3/+2
2007-08-31 Tobias Burnus <burnus@net-b.de> PR fortran/33232 * io.c (match_io): Also diagnose extra comma for READ. 2007-08-31 Tobias Burnus <burnus@net-b.de> PR fortran/33232 * gfortran.dg/eor_handling_2.f90: Add dg-warnings. * gfortran.dg/read_1.f90: New. From-SVN: r127997
2007-08-10re PR fortran/32987 (TAB in FORMAT: accept extension, warn with -std=f*)Tobias Burnus1-11/+72
2007-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/32987 * io.c (format_token): Add FMT_ERROR. (next_char_not_space): Print error/warning when '\t' are used in format specifications. (format_lex): Propagate error. (check_format): Ditto. 2007-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/32987 * io/format.c (next_char): Treat '\t' as ' ' in format specification. 2007-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/32987 * gfortran.dg/fmt_tab_1.f90: New. * gfortran.dg/fmt_tab_2.f90: New. From-SVN: r127324
2007-08-01arith.c: Change copyright header to refer to version 3 of the GNU General ↵Nick Clifton1-4/+3
Public... * arith.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c, iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c, dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c, gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c, trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c, scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h, lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c, trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c, arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h, primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise. From-SVN: r127129
2007-07-04re PR fortran/32545 (Give an (compile time) error not a warning for wrong ↵Jerry DeLisle1-17/+8
edit format statements) 2007-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32545 * io.c (check_format): Always call gfc_error for errors. (check_format_string): Change type of this function to try and return the result of check_format. (check_io_constraints): Return MATCH_ERROR if check_format_string returns FAILURE. 2007-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32612 * decl.c (get_proc_name): Include attr->mod_proc in check for error. From-SVN: r126295
2007-06-30re PR fortran/32555 (Miscompilation of NIST testsuite)Tobias Burnus1-0/+1
2007-06-30 Tobias Burnus <burnus@net-b.de> PR fortran/32555 * io.c (check_format): Allow zero to precede the P edit descriptor. 2007-06-30 Tobias Burnus <burnus@net-b.de> PR fortran/32555 * gfortran.dg/fmt_zero_check.f90: New. From-SVN: r126152
2007-06-29re PR fortran/32483 (edit descriptor checking: Compile-time check for zero ↵Tobias Burnus1-9/+21
width for reading) 2007-06-29 Tobias Burnus <burnus@net-b.de> PR fortran/32483 * io.c (format_lex): Fix FMT_ZERO. (check_format,check_format_string,gfc_match_format, check_io_constraints) Additional checking for READ. 2007-06-29 Tobias Burnus <burnus@net-b.de> PR fortran/32483 * gfortran.dg/fmt_read_2.f90: New. From-SVN: r126107
2007-06-22re PR fortran/31162 (missing warning for real do-loops with implicit typed ↵Jerry DeLisle1-1/+1
variables) 2007-06-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31162 * resolve.c (gfc_resolve_iterator_expr): Add check for REAL using gfc_notify_standard. (gfc_resolve_iterator): Remove check. (resolve_branch): Change "Obsolete" to "Deleted feature". * io.c (resolve_tag): Ditto. * match.c (gfc_match_pause, gfc_match_assign, gfc_match_goto): Ditto. From-SVN: r125938
2007-06-08re PR fortran/32223 (Backslash handling inconsistent)Steven G. Kargl1-31/+8
2007-06-07 Steven G. Kargl <kargl@gcc.gnu.org> Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32223 * match.c (gfc_match_special_char): New function. Match special char. Add handling '\0'. * match.h: Add prototype. * io.c (next_char): Use it. * primary.c (next_string_char): Ditto. Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org> From-SVN: r125557
2007-06-07decl.c: Miscellaneous whitespace fixes.Steven G. Kargl1-1/+1
* decl.c: Miscellaneous whitespace fixes. * expr.c: Likewise. * gfortran.h: Likewise. * interface.c : Likewise. * io.c: Likewise. * match.c: Likewise. * match.h: Likewise. * module.c: Likewise. * parse.c: Likewise. * resolve.c: Likewise. * symbol.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. From-SVN: r125533
2007-05-26re PR fortran/31813 (Warn about deleted feature: H edit descriptor)Jerry DeLisle1-13/+15
2007-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31813 * io.c (check_format): Add warning for H specifier in format. From-SVN: r125097
2007-01-26Steven G.Steven G. Kargl1-2/+43
2007-01-26 Steven Bosscher <stevenb.gcc@gmail.com> Steven G. Kargl <kargl@gcc.gnu,org> * testsuite/gfortran.dg/backslash_3.f: New test. * fortran/io.c (next_char): Deal with backslash escaped characters. Issue warnings in non -std=gnu cases. * fortran/primary.c (next_string_char): Issue warnings in non From-SVN: r121218
2007-01-08interface.c, [...]: Update Copyright years.Steven G. Kargl1-173/+157
2007-01-08 Steven G. Kargl <kargl@gcc.gnu.org> * interface.c, intrinsic.c, gfortranspec.c, io.c, f95-lang.c, iresolve.c, match.c: Update Copyright years. Whitespace. From-SVN: r120587
2006-12-28re PR libfortran/30014 (INQUIRE (iolength = xx) limited to kind=4)Jerry DeLisle1-1/+9
2006-12-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30014 *io.c (resolve_tag): Don't issue error for tag_size type not being default integer size for -std=F2003. Add similar check for tag_iolength. *ioparm.def: Change size and iolength parameters to ioint pointer, which corresponds to GFC_IO_INT on the library side. From-SVN: r120233
2006-11-18re PR fortran/24285 ([4.2 only] format(1000(a,$)))Francois-Xavier Coudert1-3/+4
PR fortran/24285 * io.c (check_format): Allow dollars everywhere in format, and issue a warning. * gfortran.dg/dollar_edit_descriptor-3.f: New test. From-SVN: r118971
2006-11-15data.c: Remove trailing periods from error messages.Brooks Moses1-1/+1
* data.c: Remove trailing periods from error messages. * decl.c: Likewise. * expr.c: Likewise. * io.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * resolve.c: Likewise. * symbol.c: Likewise. * trans-io.c: Likewise. From-SVN: r118880
2006-11-07decl.c (match_attr_spec, [...]): Unify gfc_notify_std message for GFC_STD_F2003.Tobias Burnus1-1/+1
fortran/ 2006-11-06 Tobias Burnus <burnus@net-b.de> * decl.c (match_attr_spec, gfc_match_enum): Unify gfc_notify_std message for GFC_STD_F2003. * array.c (gfc_match_array_constructor): Unify gfc_notify_std message for GFC_STD_F2003. * io.c (check_io_constraints): Unify gfc_notify_std message for GFC_STD_F2003. * resolve.c (resolve_actual_arglist): Unify gfc_notify_std message for GFC_STD_F2003. testsuite/ 2006-11-06 Tobias Burnus <burnus@net-b.de> * gfortran.dg/io_constraints_2.f90: Adjust pattern for matching error messages. * gfortran.dg/specifics_3.f90: Adjust pattern for matching error messages. From-SVN: r118542
2006-10-30re PR fortran/29452 (Keyword check for specifiers in WRITE and READ)Tobias Burnus1-2/+2
fortran/ 2006-10-30 Tobias Burnus <burnus@net-b.de> PR fortran/29452 * io.c (check_io_constraints): Fix keyword string comparison. libgfortran/ 2006-10-30 Tobias Burnus <burnus@net-b.de> PR fortran/29452 * runtime/string.c (compare0): Check whether string lengths match. testsuite/ 2006-10-30 Tobias Burnus <burnus@net-b.de> PR fortran/29452 * gfortran.dg/write_check.f90: Check run-time keyword checking. * gfortran.dg/write_check2.f90: Check compile-time keyword checking From-SVN: r118191
2006-10-28re PR fortran/28224 (gfortran should support namelist (nml) for internal ↵Tobias Burnus1-3/+7
file units) fortran/ 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/28224 * io.c (check_io_constraints): Allow namelists for internal files for Fortran 2003. testsuite/ 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/28224 * gfortran.dg/io_constraints_2.f90: Use -std=f95. * gfortran.dg/namelist_internal.f90: New test. From-SVN: r118113
2006-10-16io.c (gfc_match_close): Ensure that status is terminated by a NULL element.Kaz Kojima1-1/+1
* io.c (gfc_match_close): Ensure that status is terminated by a NULL element. From-SVN: r117785
2006-10-16re PR fortran/29403 ([4.1 only] print ('(a)') not working, print '(a) works)Steven G. Kargl1-4/+21
2006-10-15 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/29403 * io.c (match_io): Check for a default-char-expr for PRINT format. From-SVN: r117764
2006-10-13re PR fortran/21435 (fails to open nonexisting file with status scratch)François-Xavier Coudert1-0/+342
PR fortran/21435 * io.c (compare_to_allowed_values): New function. (gfc_match_open): Add checks for constant values of specifiers. (gfc_match_close): Add checks for constant values of the STATUS specifier. * gcc/testsuite/gfortran.dg/io_constraints_3.f90: New test. * gcc/testsuite/gfortran.dg/open_access_append_1.f90: Add checks for compile-time warnings. * gcc/testsuite/gfortran.dg/pr20163-2.f: Likewise. * gcc/testsuite/gfortran.dg/iostat_2.f90: Likewise. * gcc/testsuite/gfortran.dg/label_4.f90: Delete the temporary file. * gcc/testsuite/gfortran.dg/direct_io_2.f90: Add a FILE= specifier. * gcc/testsuite/gfortran.dg/iomsg_1.f90: Add check for compile-time warning. From-SVN: r117685
2006-08-15re PR fortran/25828 ([f2003] ACCESS='STREAM' io support)Jerry DeLisle1-0/+9
2006-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25828 * gfortran.h: Add new pointer for stream position to st_inquire. Rename gfc_large_io_int_kind to gfc_intio_kind. * trans-types.c (gfc_init_kinds): use gfc_intio_kind. * io.c: Add new IO tag for file position going in and another for out. (match_dt_element): Match new tag_spos. (gfc_resolve_dt): Resolve new tag_spos. (gfc_free_inquire): Free inquire->strm_pos. (match_inquire_element): Match new tag_strm_out. (gfc_resolve_inquire): Resolve new tag_strm_out. * trans-io.c: Rename IOPARM_type_large_io_int to IOPARM_type_intio. (gfc_build_st_parameter): Same. (gfc_build_io_library_fndecls) Same. and add build pointer type pintio. (gfc_trans_inquire): Translate strm_pos for inquire. * ioparm.def: Reorder flags to accomodate addition of new inquire flag for strm_pos_out and add it in. From-SVN: r116171
2006-07-16re PR fortran/28384 (ICE on non-existent COMMON block)Paul Thomas1-0/+6
2006-07-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/28384 * trans-common.c (translate_common): If common_segment is NULL emit error that common block does not exist. PR fortran/20844 * io.c (check_io_constraints): It is an error if an ADVANCE specifier appears without an explicit format. PR fortran/28201 * resolve.c (resolve_generic_s): For a use_associated function, do not search for an alternative symbol in the parent name space. PR fortran/20893 * resolve.c (resolve_elemental_actual): New function t combine all the checks of elemental procedure actual arguments. In addition, check of array valued optional args(this PR) has been added. (resolve_function, resolve_call): Remove parts that treated elemental procedure actual arguments and call the above. 2006-07-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/20844 * gfortran.dg/io_constaints_2.f90: Add the test for ADVANCE specifiers requiring an explicit format tag.. PR fortran/28201 * gfortran.dg/generic_5: New test. PR fortran/20893 * gfortran.dg/elemental_optional_args_1.f90: New test. From-SVN: r115499
2006-07-07re PR fortran/28237 (print call())Paul Thomas1-0/+7
2006-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/28237 PR fortran/23420 * io.c (resolve_tag): Any integer that is not an assigned variable is an error. 2006-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/28237 PR fortran/23420 * gfortran.dg/print_fmt_5.f90: New test. From-SVN: r115246
2006-05-29re PR fortran/27634 (formatted reading/writing: real format without dot)Jerry DeLisle1-5/+14
2006-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/27634 * io.c (check_format): Add error for missing period in format specifier unless -std=legacy. * gfortran.texi: Add description of expanded namelist read and missing period in format extensions. From-SVN: r114213
2006-05-26re PR fortran/23151 (print (buf, format), expression should be invalid)Thomas Koenig1-0/+6
2006-05-26 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23151 * io.c (match_io): print (1,*) is an error. 2006-05-26 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23151 * gfortran.dg/inquire_9.f90: Fix illegal print syntax. * gfortran.dg/print_parentheses_1.f: New test. * gfortran.dg/print_parentheses_2.f90: New test. From-SVN: r114138
2006-03-27io.c (check_io_constraints): Don't look at ↵Jakub Jelinek1-10/+14
dt->advance->value.charater.string, unless it is a CHARACTER constant. * io.c (check_io_constraints): Don't look at dt->advance->value.charater.string, unless it is a CHARACTER constant. * gfortran.dg/advance_2.f90: New test. * gfortran.dg/advance_3.f90: New test. From-SVN: r112417