(j3.2006) (SC22WG5.5439) RE: Proposal of a new requirement : CMDMSG optional argument in 3 subroutines
Rafik Zurob
rzurob
Wed Jan 28 22:16:31 EST 2015
Hello
I'm not against adding a message argument in principle.
I'm not sure I fully appreciate how it would be useful for these
intrinsics, however. For example, in the case of
get_environment_variable, the standard is explicit about the values
assigned to the status argument:
?1 if the VALUE argument is present and has a length less than the
significant length of the environment variable.
1 if the specified environment variable does not exist
2 if the processor does not support environment variables
>2 Processor-dependent values greater than 2 may be assigned for other
error conditions.
I assume that a message argument would only be useful for status values >
2 since they are processor-dependent. So the question (IMHO) is, are
there actually many status values out there that are > 2?
In the case of XL Fortran, we set status to 3 if we're out of memory. In
such a case, I doubt we'd have enough memory to open the message catalogue
and retrieve a localized message to store into the message argument. We
don't have any other status values > 2. I'm not sure about all the other
vendors, but I checked the manuals of 2 other compilers and didn't see a
definition of values > 2. I also checked the POSIX spec page for getenv()
to see if it defines any errors -- it does not. (I'm not saying everyone
on UNIX/Linux/BSD calls getenv(). I was just thinking that if getenv()
defined errors, some vendors might have defined status > 2 values to
correspond to those errors.) The Windows GetEnvironmentVariable function
also does not appear to define errors not covered by status values -1 to
1.
Regards
Rafik
j3-bounces at mailman.j3-fortran.org wrote on 27/01/2015 12:35:21 PM:
> From: "Craig Dedo CAPM" <craig at ctdedo.com>
> To: "WG5 Mailing List" <sc22wg5 at open-std.org>
> Date: 27/01/2015 12:52 PM
> Subject: (j3.2006) (SC22WG5.5438) RE: Proposal of a new requirement
> : CMDMSG optional argument in 3 subroutines
> Sent by: j3-bounces at mailman.j3-fortran.org
>
> Everyone:
> Bernard, thank you very much for bringing this idea to
> everyone on the WG5 Mailing List.
>
> I think this is a great idea. It would be very helpful
> to have the command message text available in these three
> subroutines, just as it is available in Execute_Command_Line. I?m
> surprised someone didn?t bring this up earlier. Is it possible to
> fit this into the development schedule for Fortran 2015?
>
> What do other think about:
> (1) The merit of the idea.
> (2) The ability to fit this into the development
> schedule of Fortran 2015.
>
> Please feel free to contact me at any time with any
> questions or concerns that you may have. I am looking forward to
> hearing from you soon.
>
> Sincerely,
> Craig T. Dedo, CAPM
> 17130 W. Burleigh Place
> P. O. Box 423 Mobile Phone: (414) 412-5869
> Brookfield, WI 53008-0423 E-mail: <craig at ctdedo.com>
> USA
> Linked-In: http://www.linkedin.com/in/craigdedo
> > -----Original Message-----
> > From: j3-bounces at mailman.j3-fortran.org [mailto:j3-
> bounces at mailman.j3-fortran.org]
> > On Behalf Of Bernard PICHON
> > Sent: Tuesday, January 27, 2015 06:58
> > To: sc22wg5 at open-std.org
> > Subject: (j3.2006) (SC22WG5.5437) Proposal of a new requirement :
> CMDMSG optional
> > argument in 3 subroutines
> >
> > Dear all members of WG5
> >
> > In the past I suggested to introduce in Fortran some means to
> retrieve ?error
> > message? from the processor. This feature is now standardized with
> keywords IOMSG=
> > for I/O routines, keyword ERRMSG= for memory and image control
> routines and the
> > optional argument CMDMSG is defined in EXECUTE_COMMAND_LINE
subroutine.
> >
> > I encounter these days some difficulties with the subroutine
> > GET_ENVIRONMENT_VARIABLE and discovered that this subroutine
> doesn?t implement any
> > means to retrieve ?error message? from the host processor although
> the optional
> > argument STATUS is defined.
> >
> > So, I put to WG5 the following requirement written by analogy with
> > EXECUTE_COMMAND_LINE subroutine :
> >
> > Note that you may receive this mail twice due to a change in my
> mail address ;
> > sorry for that !!
> >
> > ==================================================
> > ===================================
> >
> > Add the optional argument CMDMSG in subroutines GET_COMMAND ,
> GET_COMMAND_ARGUMENT
> > and GET_ENVIRONMENT_VARIABLE with this edit :
> >
> > CMDMSG (optional) shall be a default character scalar. It is an
> INTENT (INOUT)
> > argument. If an error condition occurs, it is assigned a
processor-dependent
> > explanatory message.
> > Otherwise, it is unchanged.
> >
> > ==================================================
> > ====================================
> >
> > Dr. Bernard PICHON (from France)
> > CNRS ? Observatoire de la C?te d?Azur (OCA)
> >
> >
> > _______________________________________________
> > J3 mailing list
> > J3 at mailman.j3-fortran.org
> > http://mailman.j3-fortran.org/mailman/listinfo/j3
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
More information about the J3
mailing list