diff options
author | phk <phk@FreeBSD.org> | 1998-07-24 07:13:57 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-07-24 07:13:57 +0000 |
commit | 2e8d660a6e06bae5d9351ab209a17e5bdb4803fa (patch) | |
tree | 4149006a43a57f005f52162147338562ea5d062a /usr.bin/f2c | |
parent | 5b6f7049f1d88502a7f525ad2111dc54bc0c5aa3 (diff) | |
download | FreeBSD-src-2e8d660a6e06bae5d9351ab209a17e5bdb4803fa.zip FreeBSD-src-2e8d660a6e06bae5d9351ab209a17e5bdb4803fa.tar.gz |
During compilation of a Fortran program f2c/f77 will spew the
name of entry points, functions, subroutines, and program to
stderr error. The enclosed patches do 3 things:
(1) Silenced the output to stderr.
(2) Added a -v option to f2c and f77. This will turn on a verbose
mode, and dumps quite a bit of stuff to stderr.
(3) Updated the f2c man page.
PR: 7369
Submitted by: Steven G. Kargl <kargl@troutmask.apl.washington.edu>
Diffstat (limited to 'usr.bin/f2c')
-rw-r--r-- | usr.bin/f2c/f2c.1 | 4 | ||||
-rw-r--r-- | usr.bin/f2c/main.c | 4 | ||||
-rw-r--r-- | usr.bin/f2c/proc.c | 26 |
3 files changed, 23 insertions, 11 deletions
diff --git a/usr.bin/f2c/f2c.1 b/usr.bin/f2c/f2c.1 index 4011fcb..08e99ed 100644 --- a/usr.bin/f2c/f2c.1 +++ b/usr.bin/f2c/f2c.1 @@ -33,7 +33,7 @@ .Nd Convert Fortran 77 to C or C++ .Sh SYNOPSIS .Nm f2c -.Op Fl AaCcEfgpRrsUuw +.Op Fl AaCcEfgpRrsUuvw .Op Fl C++ .Op Fl cd .Op Fl d Ar dir @@ -195,6 +195,8 @@ may change prototypes or declarations. .It Fl p Supply preprocessor definitions to make common-block members look like local variables. +.It Fl v +Echo the file name, program name, and procedure name(s) during compilation. .It Fl R Do not promote REAL functions and operations to DOUBLE PRECISION. Option .Fl !R diff --git a/usr.bin/f2c/main.c b/usr.bin/f2c/main.c index 4183855..7237905 100644 --- a/usr.bin/f2c/main.c +++ b/usr.bin/f2c/main.c @@ -49,6 +49,7 @@ flag r8flag = NO; flag use_bs = YES; flag keepsubs = NO; flag byterev = NO; +flag echo = NO; int intr_omit; static int no_cd, no_i90; #ifdef TYQUAD @@ -128,6 +129,7 @@ static arg_info table[] = { f2c_entry ("Nl", P_ONE_ARG, P_INT, &maxlablist, 0), f2c_entry ("c", P_NO_ARGS, P_INT, &addftnsrc, YES), f2c_entry ("p", P_NO_ARGS, P_INT, &usedefsforcommon, YES), + f2c_entry ("v", P_NO_ARGS, P_INT, &echo, YES), f2c_entry ("R", P_NO_ARGS, P_INT, &forcedouble, NO), f2c_entry ("!R", P_NO_ARGS, P_INT, &forcedouble, YES), f2c_entry ("A", P_NO_ARGS, P_INT, &Ansi, YES), @@ -563,7 +565,7 @@ main(int argc, char **argv) if(inilex( copys(file_name) )) done(1); - if (filename0) { + if (filename0 && echo) { fprintf(diagfile, "%s:\n", file_name); fflush(diagfile); } diff --git a/usr.bin/f2c/proc.c b/usr.bin/f2c/proc.c index 6796d52..2273e24 100644 --- a/usr.bin/f2c/proc.c +++ b/usr.bin/f2c/proc.c @@ -433,6 +433,8 @@ startproc(progname, class) startproc(Extsym *progname, int class) #endif { + extern flag echo; + register struct Entrypoint *p; p = ALLOC(Entrypoint); @@ -458,13 +460,15 @@ startproc(Extsym *progname, int class) entries = p; procclass = class; - fprintf(diagfile, " %s", (class==CLMAIN ? "MAIN" : "BLOCK DATA") ); - if(progname) { - fprintf(diagfile, " %s", progname->fextname); - procname = progname->cextname; + if (echo) { + fprintf(diagfile, " %s", (class==CLMAIN ? "MAIN" : "BLOCK DATA") ); + if(progname) { + fprintf(diagfile, " %s", progname->fextname); + procname = progname->cextname; + } + fprintf(diagfile, ":\n"); + fflush(diagfile); } - fprintf(diagfile, ":\n"); - fflush(diagfile); } /* subroutine or function statement */ @@ -521,15 +525,19 @@ entrypt(class, type, length, entry, args) entrypt(int class, int type, ftnint length, Extsym *entry, chainp args) #endif { + extern flag echo; + register Namep q; register struct Entrypoint *p; if(class != CLENTRY) puthead( procname = entry->cextname, class); - else + else if (echo) fprintf(diagfile, " entry "); - fprintf(diagfile, " %s:\n", entry->fextname); - fflush(diagfile); + if (echo){ + fprintf(diagfile, " %s:\n", entry->fextname); + fflush(diagfile); + } q = mkname(entry->fextname); if (type == TYSUBR) q->vstg = STGEXT; |