This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch checked in for obvious bug in gcov.c


	I checked in the following patch which fixes an obvious bug in
the definition of function fnotice in gcov.c.  It was missing the
first parameter which should have been a FILE*.  In the process, I did
some warning cleanup relating to fnotice.

		--Kaveh


Index: ChangeLog
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ChangeLog,v
retrieving revision 1.2872
diff -u -p -r1.2872 ChangeLog
--- ChangeLog	1999/01/30 18:36:32	1.2872
+++ ChangeLog	1999/01/31 04:16:14
@@ -1,3 +1,13 @@
+Sat Jan 30 23:14:13 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* gcov.c (fnotice): Add missing FILE* parameter.
+	(function_summary): Fix format specifiers in calls to `fnotice'.
+	(output_data): Likewise.
+
+	* toplev.c (fnotice): Constify char* parameter.
+
+	* toplev.h (fnotice): Add prototype.
+
 Sun Jan 31 15:33:09 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
 	* config/c4x/c4x.h (RTX_COSTS): Explicitly define c4x costs.
Index: gcov.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/gcov.c,v
retrieving revision 1.16
diff -u -p -r1.16 gcov.c
--- gcov.c	1999/01/30 18:57:02	1.16
+++ gcov.c	1999/01/31 04:16:18
@@ -244,11 +244,12 @@ main (argc, argv)
   return 0;
 }
 
-static void fnotice	PVPROTO ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+static void fnotice PVPROTO ((FILE *, const char *, ...)) ATTRIBUTE_PRINTF_2;
 static void
-fnotice VPROTO ((const char *msgid, ...))
+fnotice VPROTO ((FILE *file, const char *msgid, ...))
 {
 #ifndef ANSI_PROTOTYPES
+  FILE *file;
   const char *msgid;
 #endif
   va_list ap;
@@ -256,10 +257,11 @@ fnotice VPROTO ((const char *msgid, ...)
   VA_START (ap, msgid);
 
 #ifndef ANSI_PROTOTYPES
+  file = va_arg (ap, FILE *);
   msgid = va_arg (ap, const char *);
 #endif
 
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (file, _(msgid), ap);
   va_end (ap);
 }
 
@@ -922,7 +924,7 @@ static void
 function_summary ()
 {
   if (function_source_lines)
-    fnotice (stdout, "%6.2lf%% of %d source lines executed in function %s\n",
+    fnotice (stdout, "%6.2f%% of %d source lines executed in function %s\n",
 	     (((double) function_source_lines_executed / function_source_lines)
 	      * 100), function_source_lines, function_name);
   else
@@ -933,18 +935,18 @@ function_summary ()
     {
       if (function_branches)
 	{
-	  fnotice (stdout, "%6.2lf%% of %d branches executed in function %s\n",
+	  fnotice (stdout, "%6.2f%% of %d branches executed in function %s\n",
 		   (((double) function_branches_executed / function_branches)
 		    * 100), function_branches, function_name);
 	  fnotice (stdout,
-		"%6.2lf%% of %d branches taken at least once in function %s\n",
+		"%6.2f%% of %d branches taken at least once in function %s\n",
 		   (((double) function_branches_taken / function_branches)
 		    * 100), function_branches, function_name);
 	}
       else
 	fnotice (stdout, "No branches in function %s\n", function_name);
       if (function_calls)
-	fnotice (stdout, "%6.2lf%% of %d calls executed in function %s\n",
+	fnotice (stdout, "%6.2f%% of %d calls executed in function %s\n",
 		 (((double) function_calls_executed / function_calls)
 		  * 100), function_calls, function_name);
       else
@@ -1082,7 +1084,7 @@ output_data ()
 			fnotice (stderr,
 				 "didn't use all bb entries of graph, function %s\n",
 				 function_name);
-			fnotice (stderr, "block_num = %d, num_blocks = %d\n",
+			fnotice (stderr, "block_num = %ld, num_blocks = %d\n",
 				 block_num, current_graph->num_blocks);
 		      }
 
@@ -1197,7 +1199,7 @@ output_data ()
 
       if (total_source_lines)
 	fnotice (stdout,
-		 "%6.2lf%% of %d source lines executed in file %s\n",
+		 "%6.2f%% of %d source lines executed in file %s\n",
 		 (((double) total_source_lines_executed / total_source_lines)
 		  * 100), total_source_lines, source_file_name);
       else
@@ -1208,18 +1210,18 @@ output_data ()
 	{
 	  if (total_branches)
 	    {
-	      fnotice (stdout, "%6.2lf%% of %d branches executed in file %s\n",
+	      fnotice (stdout, "%6.2f%% of %d branches executed in file %s\n",
 		       (((double) total_branches_executed / total_branches)
 			* 100), total_branches, source_file_name);
 	      fnotice (stdout,
-		    "%6.2lf%% of %d branches taken at least once in file %s\n",
+		    "%6.2f%% of %d branches taken at least once in file %s\n",
 		       (((double) total_branches_taken / total_branches)
 			* 100), total_branches, source_file_name);
 	    }
 	  else
 	    fnotice (stdout, "No branches in file %s\n", source_file_name);
 	  if (total_calls)
-	    fnotice (stdout, "%6.2lf%% of %d calls executed in file %s\n",
+	    fnotice (stdout, "%6.2f%% of %d calls executed in file %s\n",
 		     (((double) total_calls_executed / total_calls)
 		      * 100), total_calls, source_file_name);
 	  else
Index: toplev.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.150
diff -u -p -r1.150 toplev.c
--- toplev.c	1999/01/30 14:34:11	1.150
+++ toplev.c	1999/01/31 04:16:26
@@ -1557,11 +1557,11 @@ notice VPROTO((const char *msgid, ...))
 }
 
 void
-fnotice VPROTO((FILE *file, char *msgid, ...))
+fnotice VPROTO((FILE *file, const char *msgid, ...))
 {
 #ifndef ANSI_PROTOTYPES
   FILE *file;
-  char *msgid;
+  const char *msgid;
 #endif
   va_list ap;
 
@@ -1569,7 +1569,7 @@ fnotice VPROTO((FILE *file, char *msgid,
 
 #ifndef ANSI_PROTOTYPES
   file = va_arg (ap, FILE *);
-  msgid = va_arg (ap, char *);
+  msgid = va_arg (ap, const char *);
 #endif
 
   vnotice (file, msgid, ap);
Index: toplev.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.h,v
retrieving revision 1.15
diff -u -p -r1.15 toplev.h
--- toplev.h	1999/01/18 08:53:38	1.15
+++ toplev.h	1999/01/31 04:16:26
@@ -102,4 +102,7 @@ extern void do_abort			PROTO ((void)) AT
 extern void botch			PROTO ((const char *))
   ATTRIBUTE_NORETURN;
 
+extern void fnotice			PROTO ((FILE *, const char *, ...))
+  ATTRIBUTE_PRINTF_2;
+
 #endif /* __GCC_TOPLEV_H */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]