| Re: Reading external variables from a library (BIND) |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.fortran · Group Profile
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Sep 17, 2008 02:30
Ian Bush wrote:
(snip)
>>I did not do it that way, because a function without arguments
>>can be optimised away - cf. the design of random_number.
> Maybe
> volatile int get_errno() {
> return errno;
> ? No idea if you can do this in C. In fortran at least according to
> MR&C volatile can only be applied to variables
As far as I know, C never optimizes away such calls.
Note that C only has functions, no subroutines.
There are no ELEMENTAL or PURE functions in C.
One of the more common argumentless functions (though
usually a C preprocessor macro) is getchar() which returns
the next character from stdin.
-- glen
|