aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
AgeCommit message (Collapse)AuthorFilesLines
2015-04-21re PR libfortran/65234 (Output descriptor (*(1E15.7)) not accepted)Jerry DeLisle1-2/+11
2015-04-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/65234 * io/format.c (parse_format_list): Set the seen_dd flag in all cases where a data descriptor has been seen. From-SVN: r222274
2015-04-21re PR fortran/56743 (Namelist bug with comment and no blank)Jerry DeLisle1-2/+5
2015-04-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/56743 * io/list_read.c (CASE_SEPARATORS): Add case for '!'. (is_separator): Add condition for '!'. (eat_separator): Use notify_std to warn or errord if '!' is encountered before a proper separator. From-SVN: r222271
2015-04-15re PR fortran/65089 (FAIL: gfortran.dg/io_real_boz(2|_[45]).f90 when tested ↵Jerry DeLisle3-19/+55
with -fsanitize=address) 2015-04-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/65089 * io/format.h (free_format): New function to free memory allocated for building format error messages. * io/format.c (format_error): Add checks before freeing memory to avoid potential segfaults and free formatting data when needed on error conditions. Always allocate and NULL terminate the string. * io/transfer.c (st_read_done, st_write_done): Use new free_format function to clean up memory allocations when done. From-SVN: r222111
2015-03-28re PR fortran/65596 (NAMELIST bug with f2003: reads too far)Jerry DeLisle2-3/+2
2015-03-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/65596 * io/transfer.c (data_transfer_init): If in namelist mode and delimiter is not specified, set it to DELIM_QUOTE, independent of -std. * io/unit.c (init_units): Set flags.delim to the correct initial value of DELIM_UNSPECIFIED. From-SVN: r221753
2015-03-26re PR fortran/65541 (namelist regression)Jerry DeLisle1-1/+7
2015-03-25 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/65541 * io/write.c (nml_write_obj): Convert '+' to '%' before emitting object names in namelists. From-SVN: r221682
2015-03-22re PR libfortran/59513 (Fortran runtime error: Sequential READ or WRITE not ↵Jerry DeLisle1-1/+2
allowed after EOF marker, possibly use REWIND or BACKSPACE) 2015-03-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/59513 * io/transfer.c (data_transfer_init): Do not error for -std=legacy. From-SVN: r221572
2015-03-11PR 65200 Handle EPERM in addition to EACCES.Janne Blomqvist2-28/+6
gcc/fortran ChangeLog: 2015-03-11 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/65200 * gfortran.texi: Document behavior when opening files without explicit ACTION= specifier. libgfortran ChangeLog: 2015-03-11 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/65200 * io/open.c (new_unit): Use gf_strerror rather than hardcoding error messages for different errno values. * io/unix.c (regular_file2): Handle EPERM in addition to EACCES. gcc/testsuite ChangeLog: 2015-03-11 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/65200 * gfortran.dg/open_errors.f90: Update checks for iomsg string. * gfortran.dg/open_new_segv.f90: Fix error message pattern. From-SVN: r221361
2015-02-11re PR fortran/57822 (I/O: "(g0)" wrongly prints "E+0000")Jerry DeLisle1-2/+2
2015-02-10 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/57822 * io/write_float.def (output_float): Apply fix of previous patch to correctly calculate the exponent number of digits and take care of wide character output. From-SVN: r220606
2015-02-10re PR fortran/57822 (I/O: "(g0)" wrongly prints "E+0000")Jerry DeLisle1-1/+1
2015-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/57822 * io/write_float.def (output_float): If doing g0 editing and exponent is zero, do not emit exponent. From-SVN: r220564
2015-02-07re PR fortran/60956 (error reading (and writing) large text files in gfortran)Jerry DeLisle5-1/+43
2015-02-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/60956 * io/fbuf.c (fbuf_flush_list): New function that only flushes if current fbuf position exceeds a limit. * io/fbuf.h: Declare the new function. * io/io.h (enum unit_mode): Add two new modes. * io/list_read.c (list_formatted_read_scalar): Call new function. * io/write.c: Include fbuf.h. (list_formatted_write_scalar): Call new function. From-SVN: r220505
2015-01-24PR libfortran/64770 Segfault when trying to open existing file with ↵Janne Blomqvist1-1/+1
status="new". libgfortran ChangeLog: 2015-01-24 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/64770 * io/unit.c (filename_from_unit): Check that u->filename != NULL before calling strdup. testsuite ChangeLog: 2015-01-24 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/64770 * gfortran.dg/open_new_segv.f90: New test. From-SVN: r220086
2015-01-23re PR fortran/61933 (Inquire on internal units)Jerry DeLisle1-2/+2
2015-01-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/61933 * io/inquire.c (inquire_via_unit): Set existing to true for any negative unit that is currently connected and any positive units within range of KIND=4 value. The unit value for any out of range case that may occur if the user is using a KIND=8 will have been set to -2 which is reserved and can never be opened, and therefore the unit does not exist. From-SVN: r220024
2015-01-15re PR fortran/61933 (Inquire on internal units)Jerry DeLisle1-12/+4
2015-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/61933 * io/inquire.c (inquire_via_unit): Set existing to true if a gfc_unit stucture was found for the given unit number. * runtime/error.c (translate_error): Add case for LIBERROR_INQUIRE_INTERNAL_UNIT. From-SVN: r219631
2015-01-05Update copyright years.Jakub Jelinek21-21/+21
From-SVN: r219188
2014-11-13PR 60324 Unbounded stack allocations in libgfortran.Janne Blomqvist5-7/+38
2014-11-13 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/60324 * configure: Regenerated. * configure.ac (AM_CFLAGS): Add Werror=vla. * libgfortran.h (gfc_alloca): Remove macro. (fc_strdup_notrim): New prototype. * intrinsics/access.c (access_func): Use fc_strdup rather than stack allocation. * intrinsics/chdir.c (chdir_i4_sub): Likewise. (chdir_i8_sub): Likewise. * intrinsics/chmod.c (chmod_internal): New function, move logic here. (chmod_func): Call chmod_internal. * intrinsics/env.c (getenv): Use fc_strdup rather than stack allocation. (get_environment_variable_i4): Likewise. * intrinsics/execute_command_line.c (execute_command_line): Likewise. * intrinsics/hostnm.c (hostnm_0): New function, use static buffer rather than VLA. (hostnm_i4_sub): Call hostnm_0. (hostnm_i8_sub): Likewise. (hostnm): Likewise. * intrinsics/link.c (link_internal): New function, use fc_strdup rather than stack allocation. (link_i4_sub): Call link_internal. (link_i8_sub): Likewise. (link_i4): Likewise. (link_i8): Likewise. * intrinsics/perror.c (perror_sub): Use fc_strdup rather than stack allocation. * intrinsics/random.c (random_seed_i4): Use static buffer rather than VLA, use _Static_assert to make sure it's big enough. * intrinsics/rename.c (rename_internal): New function, use fc_strdup rather than stack allocation. (rename_i4_sub): Call rename_internal. (rename_i8_sub): Likewise. (rename_i4): Likewise. (rename_i8): Likewise. * intrinsics/stat.c (stat_i4_sub_0): Use fc_strdup rather than stack allocation. (stat_i8_sub_0): Likewise. * intrinsics/symlink.c (symlnk_internal): New function, use fc_strdup rather than stack allocation. (symlnk_i4_sub): Call symlnk_internal. (symlnk_i8_sub): Likewise. (symlnk_i4): Likewise. (symlnk_i8): Likewise. * intrinsics/system.c (system_sub): Use fc_strdup rather than stack allocation. * intrinsics/unlink.c (unlink_i4_sub): Likewise. * io/file_pos.c (READ_CHUNK): Make it a macro rather than variable. * io/list_read.c (nml_get_obj_data): Use fixed stack buffer, fall back to xmalloc/free for large sizes. * io/read.c (read_f): Likewise. * io/transfer.c (MAX_READ): Make it a macro rather than variable. (WRITE_CHUNK): Likewise. * io/write_float.def (write_float): Use fixed stack buffer, fall back to xmalloc/free for large sizes. * runtime/string.c (fc_strdup_notrim): New function. From-SVN: r217480
2014-11-10PR 47007 and 61847 Locale failures in libgfortran.Janne Blomqvist3-12/+102
2014-11-10 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/47007 PR libfortran/61847 * config.h.in: Regenerated. * configure: Regenerated. * configure.ac (AC_CHECK_HEADERS_ONCE): Check for xlocale.h. (AC_CHECK_FUNCS_ONCE): Check for newlocale, freelocale, uselocale, strerror_l. * io/io.h (locale.h): Include. (xlocale.h): Include if present. (c_locale): New variable. (old_locale): New variable. (old_locale_ctr): New variable. (old_locale_lock): New variable. (st_parameter_dt): Add old_locale member. * io/transfer.c (data_transfer_init): Set locale to "C" if doing formatted transfer. (finalize_transfer): Reset locale to previous. * io/unit.c (c_locale): New variable. (old_locale): New variable. (old_locale_ctr): New variable. (old_locale_lock): New variable. (init_units): Init c_locale, init old_locale_lock. (close_units): Free c_locale. * runtime/error.c (locale.h): Include. (xlocale.h): Include if present. (gf_strerror): Use strerror_l if available. Reset locale to LC_GLOBAL_LOCALE for strerror_r branch. 2014-11-10 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/47007 PR libfortran/61847 * gfortran.texi: Add note about locale issues to thread-safety section. From-SVN: r217273
2014-10-05re PR libfortran/63460 (Some namelists cannot be read from stdin (unit 5): ↵Jerry DeLisle1-0/+1
Fortran runtime error: End of file) 2014-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/63460 * io/unit.c (init_units): Initialize the DELIM flag to UNSPECIFIED for the STDIN unit so that the flag is correctly set later. From-SVN: r215908
2014-09-18Fix indentationJanne Blomqvist1-1/+1
From-SVN: r215340
2014-09-18PR libfortran/62768 Use gfc_unit.filename also when HAVE_TTYNAME{_R} is not ↵Janne Blomqvist1-2/+2
defined. 2014-09-18 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/62768 * io/inquire.c (inquire_via_unit): Use gfc_unit.filename also when HAVE_TTYNAME{_R} is not defined. From-SVN: r215338
2014-09-17PR libfortran/62768 Handle filenames with embedded null characters.Janne Blomqvist6-46/+24
testsuite ChangeLog: 2014-09-17 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/62768 * gfortran.dg/filename_null.f90: New test. libgfortran ChangeLog: 2014-09-17 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/62768 * io/io.h (gfc_unit): Store C string for the filename. * io/close.c (st_close): Use gfc_unit.filename. * io/inquire.c (inquire_via_unit): Likewise. * io/open.c (new_unit): Likewise. (already_open): Likewise, unlink file before freeing filename. * io/unit.c (init_units): Likewise. (close_unit_1): Likewise. (filename_from_unit): Likewise. * io/unix.c (compare_file_filename): Likewise. (find_file0): Likewise. (delete_file): Likewise. From-SVN: r215307
2014-09-10Fix pad status check.Janne Blomqvist1-1/+1
2014-09-10 Janne Blomqvist <jb@gcc.gnu.org> * io/transfer.c (read_block_form): Fix pad status check (found by Thomas Schwinge with -Wlogical-not-parentheses). From-SVN: r215092
2014-07-20re PR fortran/61632 (Improve error locus on large format strings)Jerry DeLisle1-10/+12
2014-07-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/61632 * io/format.c (format_error): Avoid invalid string pointer by using the fortran string length values to generate error string. (parse_format): Allocate the null terminator for the format string. From-SVN: r212875
2014-06-29re PR libfortran/61640 (KIND=4 Character Array Internal Unit Read Fail)Jerry DeLisle2-4/+4
2014-06-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/61640 * io/list_read.c (next_char_internal): Adjust the read length to a single wide character. (eat_spaces): Add missing paren. * io/unix.c (mem_read4): Use the correct mem_alloc function for wide character internal reads. From-SVN: r212118
2014-06-27re PR libfortran/61499 (Internal read of negative integer broken)Jerry DeLisle1-29/+18
2014-06-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/61499 * io/list_read.c (eat_spaces): Use a 'for' loop instead of 'while' loop to skip the loop if there are no bytes left in the string. Only seek if actual spaces can be skipped. From-SVN: r212059
2014-06-17Introduce xmallocarray, an overflow checking variant of xmalloc.Janne Blomqvist4-6/+6
2014-06-17 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xmallocarray): New prototype. * runtime/memory.c (xmallocarray): New function. (xcalloc): Check for nonzero separately instead of multiplying. * generated/*.c: Regenerated. * intrinsics/cshift0.c (cshift0): Call xmallocarray instead of xmalloc. * intrinsics/eoshift0.c (eoshift0): Likewise. * intrinsics/eoshift2.c (eoshift2): Likewise. * intrinsics/pack_generic.c (pack_internal): Likewise. (pack_s_internal): Likewise. * intrinsics/reshape_generic.c (reshape_internal): Likewise. * intrinsics/spread_generic.c (spread_internal): Likewise. (spread_internal_scalar): Likewise. * intrinsics/string_intrinsics_inc.c (string_trim): Likewise. (string_minmax): Likewise. * intrinsics/transpose_generic.c (transpose_internal): Likewise. * intrinsics/unpack_generic.c (unpack_internal): Likewise. * io/list_read.c (nml_touch_nodes): Don't cast xmalloc return value. * io/transfer.c (st_set_nml_var): Call xmallocarray instead of xmalloc. * io/unit.c (get_internal_unit): Likewise. (filename_from_unit): Don't cast xmalloc return value. * io/write.c (nml_write_obj): Likewise, formatting. * m4/bessel.m4 (bessel_jn_r'rtype_kind`): Call xmallocarray instead of xmalloc. (besse_yn_r'rtype_kind`): Likewise. * m4/cshift1.m4 (cshift1): Likewise. * m4/eoshift1.m4 (eoshift1): Likewise. * m4/eoshift3.m4 (eoshift3): Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise. * m4/in_pack.m4 (internal_pack_'rtype_ccode`): Likewise. * m4/matmul.m4 (matmul_'rtype_code`): Likewise. * m4/matmull.m4 (matmul_'rtype_code`): Likewise. * m4/pack.m4 (pack_'rtype_code`): Likewise. * m4/reshape.m4 (reshape_'rtype_ccode`): Likewise. * m4/shape.m4 (shape_'rtype_kind`): Likewise. * m4/spread.m4 (spread_'rtype_code`): Likewise. (spread_scalar_'rtype_code`): Likewise. * m4/transpose.m4 (transpose_'rtype_code`): Likewise. * m4/unpack.m4 (unpack0_'rtype_code`): Likewise. (unpack1_'rtype_code`): Likewise. * runtime/convert_char.c (convert_char1_to_char4): Likewise. (convert_char4_to_char1): Simplify. * runtime/environ.c (init_unformatted): Call xmallocarray instead of xmalloc. * runtime/in_pack_generic.c (internal_pack): Likewise. From-SVN: r211721
2014-06-08PR 56981 Flush buffer at record boundary if possible.Janne Blomqvist3-23/+39
2014-06-08 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/56981 * io/unix.h (struct stream_vtable): Add new member function, markeor. (smarkeor): New inline function. (flush_if_unbuffered): Remove prototype. * io/unix.c (raw_markeor): New function. (raw_vtable): Initialize markeor member. (buf_markeor): New function. (buf_vtable): Initialize markeor member. (mem_vtable): Likewise. (mem4_vtable): Likewise. (flush_if_unbuffered): Remove function. * io/transfer.c (next_record): Call smarkeor instead of flush_if_unbuffered. From-SVN: r211353
2014-05-26Introduce xrealloc, use it.Janne Blomqvist2-14/+6
2014-05-26 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h (xrealloc): New prototype. * runtime/memory.c (xrealloc): New function. * io/fbuf.c (fbuf_alloc): Use xrealloc. * io/list_read.c (push_char_default): Likewise. (push_char4): Likewise. From-SVN: r210948
2014-05-26[multiple changes]Jerry DeLisle1-0/+37
2014-05-26 Tobias Burnus <burnus@net-b.de> PR fortran/55117 * trans-io.c (nml_full_name, transfer_namelist_element): Insert a '+' rather then '%' to differentiate namelist variable names that are based on extended derived types. 2014-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/55117 * io/list_read.c (extended_look_ahead): New helper function to scan the namelist name and look for matches with the new '+' extended type parent indicator. (str_comp_extended): New helper function to compare the namelist name with the varname namelist. (find_nml_name): Use the new helper functions to match the extended type varnames. From-SVN: r210934
2014-05-24re PR libfortran/61173 (Erroneous "end of file" with internal read)Jerry DeLisle1-7/+11
2014-05-23 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/61173 * io/list_read.c (eat_spaces): If the next character pointed to is a space, don't seek, must be at the end. From-SVN: r210898
2014-05-22PR 60324 Handle long path names, don't use PATH_MAX.Janne Blomqvist5-114/+99
From-SVN: r210738
2014-05-18re PR libfortran/52539 (I/O: Wrong result for UTF-8/UCS-4 list-directed and ↵Jerry DeLisle2-142/+177
namelist read and nml write) 2014-05-17 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/52539 * io/io.h (gfc_unit): New function pointers *next_char_fn_ptr and *push_char_fn_ptr. *io/list_read.c (next_char): Create macro with this name to call the new function pointer. Split the original next_char function into three new functions. (next_char_default, next_char_internal, next_char_utf8): New functions. (push_char): Create macro with this name to call new function pointer. Split the original push_char into three new functions. (push_char_default, push_char_internal, push_char4): New functions. (set_workers): New function to initilize the function pointers depending on the type of IO to be performed. (list_formatted_read_scalar): Use set_workers function. (finish_list_read): Likewise. (namelist_read): Likewise. (nml_get_obj_data): Use push_char_default. From-SVN: r210574
2014-05-16PR 61187 Fix use of uninitialized memory.Janne Blomqvist1-2/+12
2014-05-16 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/61187 * io/unix.c (raw_close): Check if s->fd is -1. (fd_to_stream): Check return value of fstat(), handle error. From-SVN: r210527
2014-05-07re PR libfortran/61049 (NIST test FM906 fails)Jerry DeLisle1-14/+2
2014-05-06 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/61049 * io/list_read.c (list_formatted_read_scalar): Use eat_separator and delete extraneous code. From-SVN: r210134
2014-04-26re PR libfortran/52539 (I/O: Wrong result for UTF-8/UCS-4 list-directed and ↵Jerry DeLisle2-53/+210
namelist read and nml write) 2014-04-26 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/52539 * io/list_read.c: Add uchar typedef. (push_char4): New function to save kind=4 character. (next_char_utf8): New function to read a single UTF-8 encoded character value. (read_chracter): Update to use the new functions for reading UTF-8 strings. (list_formatted_read_scalar): Update to handle list directed reads of UTF-8 strings. (nml_read_obj): Likewise update for UTF-8 strings in namelists. * io/write.c (nml_write_obj): Add kind=4 character support for namelist writes. From-SVN: r209828
2014-04-12re PR fortran/60810 (list directed io from array results in end of file)Jerry DeLisle1-3/+1
2014-04-11 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/60810 io/unit.c (is_trim_ok): If internal unit is array, do not trim. From-SVN: r209329
2014-03-21re PR fortran/60148 (strings in NAMELIST do not honor DELIM= in open statement)Jerry DeLisle1-1/+2
2014-03-21 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/60148 * io/transfer.c (data_transfer_init): If std= was specified, set delim status to DELIM_NONE of no other was specified. From-SVN: r208759
2014-03-18configure.ac: Check for presence of fcntl.Ulrich Weigand1-1/+1
* configure.ac: Check for presence of fcntl. * configure: Regenerate. * config.h.in: Regenerate. * io/unix.c (set_close_on_exec): Check for HAVE_FCNTL. From-SVN: r208634
2014-03-18re PR libfortran/46800 (Handle CTRL-D correctly with STDIN)Jerry DeLisle1-8/+22
2014-03-17 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/46800 * io/list_read.c (list_formatted_read_scalar): Do not use eat_separator. Explicitly set the comma and end-of-line flags. Check for END condition from finish_separator. From-SVN: r208629
2014-03-15re PR fortran/58324 (Bogus END-of-line error with list-directed I/O of file ↵Jerry DeLisle1-4/+9
without trailing sequential record marker) 2014-03-15 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/58324 * io/list_read.c (finish_list_read): Read one character to check for the end of the file. If it is the end, then issue the file end error message. If not, use eat_line to reach the end without giving error. The next attempt to read will then issue the error as described above. From-SVN: r208591
2014-03-13re PR libfortran/38199 (missed optimization: I/O performance)Jerry DeLisle3-26/+62
2014-03-12 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/38199 * io/read.c (read_decimal): Quickly skip spaces to avoid calls to next_char. * io/unit.c (is_trim_ok): New helper function to check various conditions to see if its OK to trim the internal unit string. (get_internal_unit): Use LEN_TRIM to shorten selected internal unit strings for optimizing READ. Enable this optimization for formatted READ. * io/list_read.c (finish_list_read): Don't call eat_line for internal units. From-SVN: r208528
2014-03-09re PR libfortran/38199 (missed optimization: I/O performance)Jerry DeLisle1-4/+46
2014-03-08 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/38199 * io/list_read.c (next_char): Delete unuseful error checks. (eat_spaces): For character array reading, skip ahead over spaces rather than call next_char multiple times. From-SVN: r208438
2014-03-08re PR fortran/60128 (Wrong ouput using en edit descriptor)Dominique d'Humieres1-22/+31
2014-03-08 Dominique d'Humieres <dominiq@lps.ens.fr> PR libgfortran/60128 * io/write_float.def (output_float): Remove unused variable nzero_real. Replace a double space with a single one. (determine_en_precision): Fix wrong handling of the EN format. PR libfortran/60128 * gfortran.dg/fmt_en.f90: New test. From-SVN: r208423
2014-03-04re PR fortran/60148 (strings in NAMELIST do not honor DELIM= in open statement)Jerry DeLisle6-68/+99
2014-03-03 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/60148 * io/inquire.c (inquire_via_unit): In the case of DELIM_UNSPECIFIED set inquire return string to "NONE". * io/list_read.c (read_character): In the case of DELIM_NONE and namelists, complete the character read using the namelist variable length. * io/open.c (new_unit): Don't set delim status to none if not specified so that DELIM_UNSPECIFIED can be used later. * io/transfer.c (data_transfer_init): For namelist I/O, if the unit delim status is unspecified set the current status to quote. Otherwise, set current status to the unit status. * io/unit.c (get_internel_unit, init_unit): Remember to set flags_delim initially to DELIM_UNSPECIFIED so defaults come out correctly. * io/write.c (write_character): Add a new function argument "mode" to signify that raw output is to be used vs output with delimiters. If the mode is set to DELIM (1) proceed with delimiters. (list_formatted_write_scalar): Write the separator only if a delimiter was previously specified. Update the call to write_character with the mode argument given. (namelist_write_newline): Use the mode argument. (nml_write_obj): Use the mode argument. Remove use of tmp_delim. Write the semi-colon or comma correctly only when needed with using delimiters. Cleanup whitespace. (namelist_write): If delim is not specified in namelist I/O, default to using quotes. Get rid of the tmp_delim variable and use the new mode argument in write_character. From-SVN: r208302
2014-02-21re PR fortran/60286 (INQUIRE reports STDOUT as not writable)Tobias Burnus1-26/+20
2014-02-21 Tobias Burnus <burnus@net-b.de> PR fortran/60286 * libgfortran/io/inquire.c (yes, no): New static const char * vars. (inquire_via_unit): Use them. Use OPEN mode instead of using POSIX's access to query about write=, read= and readwrite=. 2014-02-21 Tobias Burnus <burnus@net-b.de> PR fortran/60286 * gfortran.dg/inquire_16.f90: New. From-SVN: r207979
2014-01-21write_float.def (output_float): Remove inadvertent test code from previous ↵Jerry DeLisle1-2/+2
patch. 2014-01-20 Jerry DeLisle <jvdelisle@gcc.gnu> Dominique d'Humieres <dominiq@lps.ens.fr> * io/write_float.def (output_float): Remove inadvertent test code from previous patch. Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr> From-SVN: r206865
2014-01-19re PR libfortran/59771 (Cleanup handling of Gw.0 and Gw.0Ee format)Jerry DeLisle1-9/+13
2014-01-19 Jerry DeLisle <jvdelisle@gcc.gnu> Dominique d'Humieres <dominiq@lps.ens.fr> PR libfortran/59771 PR libfortran/59774 PR libfortran/59836 * io/write_float.def (output_float): Fix wrong handling of the Fw.0 format. (output_float_FMT_G_): Fixes rounding issues with -m32. Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr> From-SVN: r206785
2014-01-11re PR fortran/59700 (Misleading/buggy runtime error message: Bad integer for ↵Jerry DeLisle2-23/+28
item 0 in list input) 2014-01-11 Jerry DeLisle <jvdelisle@gcc.gnu> Dominique d'Humieres <dominiq@lps.ens.fr> Steven G. Kargl <kargl@gcc.gnu.org> PR libfortran/59700 PR libfortran/59764 * io/io.h (struct st_parameter_dt): Assign expanded_read flag to unused bit. Define new variable line_buffer_pos. * io/list_read.c (free_saved, next_char, l_push_char, read_logical, read_real): Replace use of item_count with line_buffer_pos for line_buffer look ahead. (read_logical, read_integer, parse_real, read_real, check_type): Adjust location of free_line to after generating error messages to retain the correct item count for the message. Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr> Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org> From-SVN: r206553
2014-01-02Update copyright years in libgfortran/Richard Sandiford21-21/+21
From-SVN: r206296
2013-12-18read.c (read_f): Convert assert to runtime error.Steven G. Kargl1-1/+3
2013-12-18 Steven G. Kargl <kargl@gcc.gnu.org> * io/read.c (read_f): Convert assert to runtime error. 2013-12-18 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/io_err_1.f90: New test. From-SVN: r206102
2013-12-17unix.c (tempfile_open): Only use the needed flag O_CLOEXEC.Andreas Tobler1-1/+1
2013-12-17 Andreas Tobler <andreast@gcc.gnu.org> * io/unix.c (tempfile_open): Only use the needed flag O_CLOEXEC. From-SVN: r206064