(j3.2006) C1x standard

Malcolm Cohen malcolm
Thu Dec 22 02:22:45 EST 2011


>It is not unusual that a Fortran program might get a string from 
>get_command_argument, and need to pass it to a C function.

Yes it is.  It is much more usual to want to pass some string one did not get 
from get_command_argument to a C function.

That does not mean it is necessarily a good idea to say that all Fortran 
character types have to be the same as C char, or even that Fortran default 
character should be the same as C char.

>I don't understand why translation between character(c_char) and char would be 
>needed.

That was not the argument.  The discussion is not enhanced by pretending people 
said things very different from what they did say.

It is perfectly obvious that if C_char is not equal to Kind('A'), i.e. that 
default character and C character are different, your proposal requires 
translation between them.  I continue to be of the opinion that that 
translation, if necessary, is best left to the programmmer to decide rather than 
the implementor since there are multiple possibilities.

Your contention that the command line is a string of single-byte characters in 
all programs and operating systems, based on your reading of the C standard 
(nice ignoring of "some other implementation-defined manner" btw), and that this 
situation will continue indefinitely into the future, is not a contention that I 
will agree with.

Not to mention that C and Unix do not cover the entire computing experience.

>If we want standard-conforming programs to rely on character(c_char) and 
>default character being the same, the standard ought to just say so, and 
>eliminate c_char as anything distinct from default character.

You might well want to do that, but I will not agree with that either.  I trust 
I do not have to spell out my objections any further.

I do not see why this (imo miniscule) programming difficulty requires a new 
feature for the standard or the warping of existing ones.

Cheers,
-- 
................................Malcolm Cohen, Nihon NAG, Tokyo. 




More information about the J3 mailing list