[Patch, libfortran] PR45629 Get rid of setjmp/longjmp in the IO library
Janne Blomqvist
blomqvist.janne@gmail.com
Tue Nov 2 08:27:00 GMT 2010
On Tue, Nov 2, 2010 at 05:27, Jerry DeLisle <jvdelisle@frontier.com> wrote:
> On 11/01/2010 04:30 PM, Janne Blomqvist wrote:
>>
>> Hi,
>>
>> the attached patch gets rid of the setjmp()/longjmp() based EOF
>> handling in list directed reads. It also fixes PR 45629.
>>
>> Tested on x86_64-unknown-linux-gnu, Ok for trunk? I understand stage
>> 1 just ended, and as EOF handling has been a rich source of tricky
>> bugs in the IO library, I'm perfectly Ok with postponing this until
>> 4.7.
>
> Overall I like the patch.
>
> I am concerned about the changes to st_parameter_dt. To be on the safe side
> I wonder if you should do something like this? (Maybe I worry too much. ;)
> )
Yes, I think you worry too much in this case. The part of
st_parameter_dt I have modified is never touches by the frontend, the
frontend just allocates space on the stack for the library to use. A
condensed version is
struct st_parameter_dt
{
>
> Index: io.h
> ===================================================================
> --- io.h (revision 164907)
> +++ io.h (working copy)
> @@ -435,7 +427,7 @@ typedef struct st_parameter_dt
> unsigned format_not_saved : 1;
> /* 14 unused bits. */
>
> - char last_char;
> + char old_last_char; /* Remove when ABI breaks. */
> char nml_delim;
>
> int repeat_count;
> @@ -446,7 +438,7 @@ typedef struct st_parameter_dt
> char *scratch;
> char *line_buffer;
> struct format_data *fmt;
> - jmp_buf *eof_jump;
> + jmp_buf *eof_jump; /* Remove when ABI breaks. */
> namelist_info *ionml;
> /* A flag used to identify when a non-standard expanded namelist
> read
> has occurred. */
> @@ -456,6 +448,7 @@ typedef struct st_parameter_dt
> largest kind. */
> char value[32];
> GFC_IO_INT size_used;
> + int last_char;
> } p;
> /* This pad size must be equal to the pad_size declared in
> trans-io.c (gfc_build_io_library_fndecls). The above structure
>
> Otherwise patch is OK.
>
> Jerry
>
--
Janne Blomqvist
More information about the Fortran
mailing list