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>
This commit is contained in:
Poul-Henning Kamp 1998-07-24 07:13:57 +00:00
parent 19ce94466c
commit 24db6e216f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37854
4 changed files with 24 additions and 12 deletions

View File

@ -4,7 +4,7 @@
"f2c %{checksubscripts:-C} %{I2} %{onetrip} %{honorcase:-U} %{u} %{w}\
%{ANSIC:-A} %{a} %{C++}\
%{c} %{E} %{ec} %{ext} %{f} %{72} %{g} %{h} %{i2} %{kr} %{krd}\
%{P} %{p} %{r} %{r8} %{s} %{w8} %{z} %{N*}\
%{P} %{p} %{v} %{r} %{r8} %{s} %{w8} %{z} %{N*}\
%i %{!pipe: -o %g.c} %{pipe:-o -}|\n",
"cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\

View File

@ -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

View File

@ -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);
}

View File

@ -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;