Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 1998 09:42:14 -0700 (PDT)
From:      "Steven G. Kargl" <kargl@troutmask.apl.washington.edu>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/7369: Silenced f2c/f77
Message-ID:  <199807221642.JAA27339@troutmask.apl.washington.edu>

next in thread | raw e-mail | index | archive | help

>Number:         7369
>Category:       bin
>Synopsis:       f2c/f77 spew output to stderr during compilition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 22 09:50:01 PDT 1998
>Last-Modified:
>Originator:     Steven G. Kargl
>Organization:
Applied Physics Lab/Univ. of Washington
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

>Description:

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.

There are two diffs enclose.  One is applied to gnu/usr.bin/cc/cc/f2c-specs.h
while the other is applied to src/usr.bin/f2c.

>How-To-Repeat:

>Fix:

*** main.c.orig	Sat Apr 12 18:13:02 1997
--- main.c	Fri Mar 13 10:46:17 1998
***************
*** 49,54 ****
--- 49,55 ----
  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,133 ****
--- 129,135 ----
      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,569 ****
  
  	if(inilex( copys(file_name) ))
  		done(1);
! 	if (filename0) {
  		fprintf(diagfile, "%s:\n", file_name);
  		fflush(diagfile);
  		}
--- 565,571 ----
  
  	if(inilex( copys(file_name) ))
  		done(1);
! 	if (filename0 && echo) {
  		fprintf(diagfile, "%s:\n", file_name);
  		fflush(diagfile);
  		}
*** proc.c.orig	Sat Apr 12 18:13:18 1997
--- proc.c	Fri Mar 13 10:53:04 1998
***************
*** 433,438 ****
--- 433,440 ----
  startproc(Extsym *progname, int class)
  #endif
  {
+ 	extern flag echo;
+ 
  	register struct Entrypoint *p;
  
  	p = ALLOC(Entrypoint);
***************
*** 458,470 ****
  	entries = p;
  
  	procclass = class;
! 	fprintf(diagfile, "   %s", (class==CLMAIN ? "MAIN" : "BLOCK DATA") );
! 	if(progname) {
! 		fprintf(diagfile, " %s", progname->fextname);
! 		procname = progname->cextname;
  		}
- 	fprintf(diagfile, ":\n");
- 	fflush(diagfile);
  }
  
  /* subroutine or function statement */
--- 460,474 ----
  	entries = p;
  
  	procclass = class;
! 	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);
  		}
  }
  
  /* subroutine or function statement */
***************
*** 521,535 ****
  entrypt(int class, int type, ftnint length, Extsym *entry, chainp args)
  #endif
  {
  	register Namep q;
  	register struct Entrypoint *p;
  
  	if(class != CLENTRY)
  		puthead( procname = entry->cextname, class);
! 	else
  		fprintf(diagfile, "       entry ");
! 	fprintf(diagfile, "   %s:\n", entry->fextname);
! 	fflush(diagfile);
  	q = mkname(entry->fextname);
  	if (type == TYSUBR)
  		q->vstg = STGEXT;
--- 525,543 ----
  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 if (echo)
  		fprintf(diagfile, "       entry ");
! 	if (echo){
! 		fprintf(diagfile, "   %s:\n", entry->fextname);
! 		fflush(diagfile);
! 		}
  	q = mkname(entry->fextname);
  	if (type == TYSUBR)
  		q->vstg = STGEXT;
*** f2c.1.orig	Fri Mar 13 10:55:01 1998
--- f2c.1	Fri Mar 13 11:04:58 1998
***************
*** 33,39 ****
  .Nd Convert Fortran 77 to C or C++
  .Sh SYNOPSIS
  .Nm f2c
! .Op Fl AaCcEfgpRrsUuw
  .Op Fl C++
  .Op Fl cd
  .Op Fl d Ar dir
--- 33,39 ----
  .Nd Convert Fortran 77 to C or C++
  .Sh SYNOPSIS
  .Nm f2c
! .Op Fl AaCcEfgpRrsUuvw
  .Op Fl C++
  .Op Fl cd
  .Op Fl d Ar dir
***************
*** 195,200 ****
--- 195,202 ----
  .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



*** f2c-specs.h.orig	Fri Mar 13 12:01:36 1998
--- f2c-specs.h	Fri Mar 13 12:02:16 1998
***************
*** 4,10 ****
     "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*}\
          %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}}\
--- 4,10 ----
     "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} %{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}}\
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807221642.JAA27339>