This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,fortran] *The* ISO C Binding patch
On Sun, Jun 24, 2007 at 12:38:03PM +0200, Andreas Schwab wrote:
> Steve Kargl <sgk@troutmask.apl.washington.edu> writes:
>
> > +NAMED_CHARCST (ISOCBINDING_NULL_CHAR, "c_null_char", '\0')
> > +NAMED_CHARCST (ISOCBINDING_ALERT, "c_alert", '\a')
> > +NAMED_CHARCST (ISOCBINDING_BACKSPACE, "c_backspace", '\b')
> > +NAMED_CHARCST (ISOCBINDING_FORM_FEED, "c_form_feed", '\f')
> > +NAMED_CHARCST (ISOCBINDING_NEW_LINE, "c_new_line", '\n')
> > +NAMED_CHARCST (ISOCBINDING_CARRIAGE_RETURN, "c_carriage_return", '\r')
> > +NAMED_CHARCST (ISOCBINDING_HORIZONTAL_TAB, "c_horizontal_tab", '\t')
> > +NAMED_CHARCST (ISOCBINDING_VERTICAL_TAB, "c_vertical_tab", '\v')
>
> Shouldn't those use the target character set?
>
These are the constants listed in Table 15.1 in the Fortran
2003 standard
Value
Name C definition C_CHAR = -1 C_CHAR /= -1
-----------------------------------------------------------
C_NULL CHAR null character CHAR(0) '\0'
C_ALERT alert ACHAR(7) '\a'
C_BACKSPACE backspace ACHAR(8) '\b'
C_FORM FEED form feed ACHAR(12) '\f'
C_NEW LINE new line ACHAR(10) '\n'
C_CARRIAGE RETURN carriage return ACHAR(13) '\r'
C_HORIZONTAL TAB horizontal tab ACHAR(9) '\t'
C_VERTICAL TAB vertical tab ACHAR(11) '\v'
For C_CHAR = -1, the mapping is through ACHAR(), which a Fortran
intrinsic function for mapping into the ASCII collating sequence.
Fortran 2003 contains the statement: "In the case that C_CHAR /= -1 the
value is specified using C syntax. The semantics of these values are
explained in 5.2.1 and 5.2.2 of the C standard."
I have only n1124.pdf, 5.2.2(2) explicitly spells these special
characters in the C_CHAR /= -1 case as above.
--
Steve