This is the mail archive of the
mailing list for the GCC project.
Re: [Fortran, Patch] PR 40110 - allow questionable but standard conform integer(kind=c_char)
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 May 2009 15:17:20 -0700
- Subject: Re: [Fortran, Patch] PR 40110 - allow questionable but standard conform integer(kind=c_char)
- References: <4A09F45F.email@example.com>
On Wed, May 13, 2009 at 12:12:47AM +0200, Tobias Burnus wrote:
> c_char is a simple parameter (of value 1) and can be used anywhere,
> e.g. in 4.5**c_char.
> Properly used it is intended for the type CHARACTER to be interoperable
> with C strings of the type "char" (usually treated as "unsigned char").
> However, in C "char" is also the smallest integer. Thus the Fortran 2003
> standard offers several INTEGER kind parameters for interoperability;
> besides, c_int, c_long and several others, there is also "c_signed_char"
> (unsigned does not exist in Fortran).
> Currently, gfortran rejects
> as C_CHAR is misused. However, is C_CHAR's value matches a valid kind
> number, there is formally speaking no reason to reject the program. (See
> the arguments of Richard Maine in the c.l.f thread, linked from the PR.)
> The following patch changes the ERROR into a WARNING, where there is
> still the hope that people actually read the warning and act upon it ...
> Bootstrapped and regtested on x86-64-linux. OK for the trunk?