------- Comment #4 from fxcoudert at gcc dot gnu dot org  2008-01-16 23:47 
-------
(In reply to comment #3)
> You need C to support libgfortran so my question here is still valid.  What is
> sizeof(char) for your target?
> 
> Seriously if the target does not define sizeof(char) as 1, it is broken and
> there is nothing to support here really.

As far as I understand: Harald is not asking about support for the SX-6 target
(it's a vector processor only used in supercomputers, and there is absolutely
no GCC or binutils support for it at all; I've used its brothers in the past).
Harald is stating that, on this target with the vendor compiler, there is no
Fortran type that corresponds to the C char. From what I remember of the SX-5
and SX-8 I've used, C is perfectly fine and has sizeof(char) == 1, there just
isn't any access to that integer kind from the Fortran world.

Actually, this corresponds to what Harald says (comment #2):

>  C_SIGNED_CHAR  =  -1
>  C_INT8_T       =  -1

Quoting from F2003: "shall be -1 if the companion C processor defines the
corresponding C type and there is no interoperating Fortran processor kind". 

>  C_INT_LEAST8_T =  -2

"[shall be] -2 if the C processor does not define the corresponding C type":
that one is weird; we do the same thing with gfortran, but only because being a
cross-platform compiler, the front-end has no way of knowing what is the type
of int_least8_t. For NEC, whose compiler is not cross-platform, I'd have
thought they could do it easily.

Now, what Harald wants is (IIUC) a -ffake-lack-of-integer-kind-1 option, that
would make gfortran behave as if it had no integer(kind=1). Though it would
help the porting process in this very particular case, my opinion on that is
that it's a feature that's way too low in the benefit/cost ratio (not that the
cost is very high, but the benefit is really small), and I'd actually oppose to
it unless new arguments are provided (or current arguments are made more
convincing).


Now, one last comment:

(In reply to comment #2)
> But by reading the standard I do not see a reason why there should
> be a 1-byte integer type.

The standard indeed mandates no such thing. (We all agree that, at least for C
intercompatibility, it's certainly a very good thing to have, though.)


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34804

Reply via email to