Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!chaph.usc.edu!aludra.usc.edu From: ajayshah@aludra.usc.edu (Ajay Shah) Newsgroups: comp.lang.fortran Subject: f2c used as fortran error checker: one experience Message-ID: <11678@chaph.usc.edu> Date: 28 Aug 90 01:10:01 GMT Sender: news@chaph.usc.edu Organization: University of Southern California, Los Angeles, CA Lines: 114 Nntp-Posting-Host: aludra.usc.edu Originator: ajayshah@aludra.usc.edu In this demo below, f2c traps one of the few million problems with fortran: not checking for the number of parameters across call, but isn't able to find inconsistent types. Any ideas on how that is to be done? I put everything into one file here, how does one make it work across a lot of files? Even checking for number of parameters would be useful to me right now. Script started on Thu Aug 23 12:59:25 1990 [prc 5] ls 1.f 2.f response [prc 6] cat 1.f implicit undefined(a-z) integer i double precision x, y call test(x,i,y) stop end subroutine test(x,y) double precision x, y return end [prc 8] f2c < 1.f MAIN: test: Warning on line 11: inconsistent calling sequences for test: here 2, previously 3 args and string lengths. /* -- translated by f2c (version of 19 June 1990 0:42:57). You must link the resulting object file with the libraries: -lF77 -lI77 -lm -lc (in that order) */ #include "f2c.h" /* Main program */ MAIN__() { /* Builtin functions */ /* Subroutine */ int s_stop(); /* Local variables */ extern /* Subroutine */ int test_(); static integer i; static doublereal x, y; test_(&x, &i, &y); s_stop("", 0L); } /* MAIN__ */ /* Subroutine */ int test_(x, y) doublereal *x, *y; { return 0; } /* test_ */ [prc 9] cat 2.f implicit undefined(a-z) integer i double precision x, y call test(x,i) stop end subroutine test(x,y) double precision x, y return end [prc 11] f2c < 2.f MAIN: Warning on line 7: local variable y never used test: /* -- translated by f2c (version of 19 June 1990 0:42:57). You must link the resulting object file with the libraries: -lF77 -lI77 -lm -lc (in that order) */ #include "f2c.h" /* Main program */ MAIN__() { /* Builtin functions */ /* Subroutine */ int s_stop(); /* Local variables */ extern /* Subroutine */ int test_(); static integer i; static doublereal x; test_(&x, &i); s_stop("", 0L); } /* MAIN__ */ /* Subroutine */ int test_(x, y) doublereal *x, *y; { return 0; } /* test_ */ [prc 12] exit script done on Thu Aug 23 13:00:18 1990 -- _______________________________________________________________________________ Ajay Shah, (213)747-9991, ajayshah@usc.edu The more things change, the more they stay insane. _______________________________________________________________________________