(j3.2006) Get_Command_Argument

Van Snyder Van.Snyder
Thu Dec 15 21:48:41 EST 2011


On Thu, 2011-12-15 at 17:54 -0800, Malcolm Cohen wrote:
> 
> >1.  Cross my fingers and hope C_Char is the same as default kind.
> 
> Will work for the time being, but...

Exactly.  I've had to rework 30-year-old code.  Until the idiots here
decided to re-write the spacecraft navigation suite in C++, the Fortran
version had legacy going back to 1956.  (They've invested 246 work years
in it, and it still doesn't work as well as the Fortran code it
"replaced" -- but it did win NASA's "software of the year" award.)

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.

> >2.  Copy the string from the command line to the one that gets sent
> to
> >the C function.
> 
> You probably want to do that anyway to put the null char on the end.
> That would 
> seem to be the appropriate time to do whatever conversions are
> necessary.

I was doing
  l = len_trim(arg)+1
  arg(l:l) = char(0,c_char)

If c_char isn't default or ASCII or ISO_10646, I don't know how to do
the translation from default to it.  That's at least part of the reason
to want to get c_char characters from get_command_argument.

> >Which leads back to the largely-ignored original question:
> 
> Not ignored, you just didn't like the answer!

I said "largely."  And the answer was "it probably works almost
everywhere for the time being."  If "almost everywhere for the time
being" is good enough, why bother with a standard instead of an informal
agreement?

Then the discussion drifted off into whether the NUMBER argument has to
be default integer, and discussions of ISO 10646 file names, and ....





More information about the J3 mailing list