Re: Intrinsic functions in fortran 90

Jan Vorbrüggen wrote:
It seems that early FORTRAN did not have mixed mode expressions at all.
There must have been a lot of XINTF function calls.  I do hope you don't
mean to go back that far.

Indeed, I would. It would certainly be a useful feature in a compiler to
provide warning of implicit conversions - I believe some do.

In my mind, this is similar to the question of typing of literals.

Well, Java requires casts for narrowing conversions but not widening ones. That doesn't seem so bad to me. I believe it will do int to float without complaining, but not float to int. That doesn't solve the 5/9 problem, but might get a good fraction of the other mistakes.

-- glen


Relevant Pages

  • Re: Abnormal program termination
    ... foo.c:4: warning: function declaration isn't a prototype ... Your version is legal under C90 rules, but int mainis more explicit ... float ave(), average; ...
  • Re: malloc inside function (I know... I *did* search google first ;)
    ... malloc.c:2: warning: return type defaults to `int' malloc.c: In function `main': malloc.c:4: warning: implicit declaration of function `initialize_f' malloc.c:6: error: parse error before '/' token malloc.c: At top level: malloc.c:12: error: conflicting types for 'initialize_f' malloc.c:4: error: previous implicit declaration of 'initialize_f' was here malloc.c: In function `initialize_f': malloc.c:14: warning: implicit declaration of function `malloc' ... int main ... float * f; ...
  • Re: Functions not matching prototypes, redux
    ... extern int foo; ... proto.c: warning C4142: benign redefinition of type ... aftercompiles "knowing" that the return is really float. ...
  • Re: is "using namespace std" good style?
    ... float calc ... int calc ... void t1(ostream& out, ... warning: argument to `int' from `const float' ...
  • Re: matrix stuff (solving b = A*x) --> using numerical recipes
    ... but then I removed it since I couldn't see any compiler warnings/errors without stdio.h). ... turn the warning level up to the maximum ... void banmul(float **a, unsigned long n, int left, int right, float x, float b); ...