[Patch, fortran] PR28585: Add Fortran 2003 NEW_LINE intrinsic function

Tobias Burnus burnus@net-b.de
Mon Sep 11 00:00:00 GMT 2006


The new_line implementation is based on achar, I hope thus that it is simple enough that it can be committed while I wait for the reply from assign@gnu.org.

Remarks:
(a) I use '\n', for Windows one probably would like to have '\r\n', but the Fortran 2003 standard requires that only a length-one character is returned.
(b) One can pass either a scalar character or a character array to new_line function.
The patch below does not work with arrays (ICE in gfc_conv_intrinsic_function). I fail to see how one allows arrays.

Tobias


2006-08-26  Tobias Burnus  <burnus@net-b.de>

     PR fortran/28585
     * intrinsic.c(add_functions): Add new_line Fortran 2003 intrinsic
       intrinsic.h: Add gfc_simplify_new_line and gfc_check_new_line prototypes
       check.c: Add gfc_check_new_line
       simplify.c: Add gfc_simplify_new_line
     * gfortran.texi: Include Fortran 2003 in the goals for gfortran
     * intrinsic.text: Document new_line intrinsic;
       cross reference INQUIRE from ACCESS intrinsic.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfortran-newline.diff
Type: text/x-patch
Size: 5832 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060911/4ac7660a/attachment.bin>


More information about the Fortran mailing list