This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getenv implementation?


Steve Kargl wrote:
> which corresponds to this block of code.
> 
>   add_sym_2s ("getenv", 0, 1, BT_UNKNOWN, 0,
> 	      NULL, NULL, NULL,
> 	      name, BT_CHARACTER, dc, 0,
> 	      val, BT_CHARACTER, dc, 0);
> 
> There is no gfc_check_getenv nor gfc_resolve_getenv function.
> How the heck is this suppose to work, particularly considering

I missed that part of your question. Answer: these functions are not needed.
There are three types of functions that can be specified when calling one of
the add_sym functions:
- simplification functions: used for constant folding at runtime. This is
needed for the evaluation of initialization expression, we also use it to
simplify other expressions in the frontend, where possible -- not needed here,
the runtime environment will not be available at compile time
- check functions: these are used to verify that the passed arguments are
actually an allowed combination of arguments. Not needed here -- the function
requires exctly two character arguments, and this is already ensured by the
argument list given in the add_sym call
- resolution functions: these are used to determine which library function to
call, as this can change depending on the datatypes of the arguments, and
depending on which arguments are present. Not needed here -- there's only one
valid combination of arguments, and therefore there's only one function that
can be called

HTH,
- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]