(j3.2006) Get_Command_Argument
Van Snyder
Van.Snyder
Thu Dec 15 23:25:05 EST 2011
On Thu, 2011-12-15 at 19:41 -0800, Malcolm Cohen wrote:
>
> > I don't know how to do
> >the translation from default to it.
>
> If you don't know what you want how do you expect us to do it? At least you
> have a fighting chance of knowing what the C routine you are calling is
> expecting so will have a clue as to whether to encode it as e.g. Shift-JIS or
> UTF-8 or just replace non-ASCII with '?' or raise an error on a non-ASCII char.
I would expect that if the VALUE argument of get_command_argument is
c_char, I could send it to a C routine without "translating" it from
c_char to c_char, whatever that might mean. Presumably, the system will
have converted it from whatever it uses internally to c_char before I
get hold of it. Maybe c_char is what it uses internally, but c_char is
not any of default, ASCII or ISO_10646, in which case it would be
hopeless for me to write, today, a translation that will work twenty
years from now when the code is ported to such a system. One might
reasonably hope that "translating" from c_char to c_char would continue
to work.
> >When somebody, in 2032, ports some of my codes that make the assumption
> >that c_char == default, which today's processors silently accept, and it
> >stops working, coping with that is an expense that could have been
> >avoided.
>
> Sometimes one just cannot predict the future.
No, but I can reliably predict some of the problems that ameliorating
shortcomings of the standard might have prevented, such as the 100
million dollar loss of Mars Climate Orbiter. I first predicted some
kind of expensive problem when I advocated in 1983 for a units system in
what became Ada, and then for Fortran 90, and then for Fortran 2003, and
then for Fortran 2008, and I will again for a future revision.
> Having a C_CHAR of GET_COMMAND that might do the "wrong translation"
> for the purposes of whatever the C routine you are calling wants would
> not ameliorate that possibility at all,...
What translation? C_char to c_char?
More information about the J3
mailing list