This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran, Patch] PR 40110 - allow questionable but standard conform integer(kind=c_char)


On Wed, May 13, 2009 at 12:12:47AM +0200, Tobias Burnus wrote:
> Hello,
> 
> 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
>    INTEGER(kind=C_CHAR)
> 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?
> 

OK.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]