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]

A patch for "unused parameter" warnings


	This patch begins to address some of the "unused parameter"
warnings.  I used ATTRIBUTE_UNUSED in cases where the parameter was
sometimes used depending on #ifdefs.

	Okay to install?

		--Kaveh



Thu Mar 18 15:52:02 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* calls.c (initialize_argument_information): Mark parameters
	`num_actuals' and `n_named_args' with ATTRIBUTE_UNUSED.

	* dbxout.c (dbxout_start_new_source_file): Likewise for parameter
	`filename'.
	(dbxout_finish): Likewise for parameters `file' and `filename'.
	(dbxout_prepare_symbol): Likewise for parameter `decl'.
	(dbxout_begin_function): Likewise.

	* explow.c (hard_function_value): Likewise for parameter `func'.

	* function.c (locate_and_pad_parm): Likewise for parameter `fndecl'.
	
	* expmed.c (expand_divmod): Omit unused argument to `expand_abs'.
	* expr.c (expand_expr): Likewise.
	* expr.h (expand_abs): Delete unused argument from prototype.
	* optabs.c (expand_abs): Remove unused parameter `unsignedp'.

	* sdbout.c (sdbout_init): Mark parameter `syms' with ATTRIBUTE_UNUSED.
	(sdbout_end_block): Likewise for parameter `n'.
	
	* toplev.c (debug_define): Likewise for parameters `lineno' and
	`buffer'.
	(debug_undef): Likewise.
	
	* varasm.c (named_section): Likewise for parameter 'reloc'.
	(assemble_external): Likewise for parameter `decl'.
	(assemble_alias): Likewise for parameter `target'.
	
	
diff -rup orig/egcs-CVS19990317/gcc/calls.c egcs-CVS19990317/gcc/calls.c
--- orig/egcs-CVS19990317/gcc/calls.c	Wed Mar 10 19:39:39 1999
+++ egcs-CVS19990317/gcc/calls.c	Thu Mar 18 11:30:47 1999
@@ -868,10 +868,10 @@ initialize_argument_information (num_act
 				 actparms, fndecl, args_so_far,
 				 reg_parm_stack_space, old_stack_level,
 				 old_pending_adj, must_preallocate, is_const)
-     int num_actuals;
+     int num_actuals ATTRIBUTE_UNUSED;
      struct arg_data *args;
      struct args_size *args_size;
-     int n_named_args;
+     int n_named_args ATTRIBUTE_UNUSED;
      tree actparms;
      tree fndecl;
      CUMULATIVE_ARGS *args_so_far;
diff -rup orig/egcs-CVS19990317/gcc/dbxout.c egcs-CVS19990317/gcc/dbxout.c
--- orig/egcs-CVS19990317/gcc/dbxout.c	Thu Feb 25 09:37:13 1999
+++ egcs-CVS19990317/gcc/dbxout.c	Thu Mar 18 11:50:51 1999
@@ -497,7 +497,7 @@ dbxout_typedefs (syms)
 
 void
 dbxout_start_new_source_file (filename)
-     char *filename;
+     char *filename ATTRIBUTE_UNUSED;
 {
 #ifdef DBX_USE_BINCL
   struct dbx_file *n = (struct dbx_file *) xmalloc (sizeof *n);
@@ -582,8 +582,8 @@ dbxout_source_line (file, filename, line
 
 void
 dbxout_finish (file, filename)
-     FILE *file;
-     char *filename;
+     FILE *file ATTRIBUTE_UNUSED;
+     char *filename ATTRIBUTE_UNUSED;
 {
 #ifdef DBX_OUTPUT_MAIN_SOURCE_FILE_END
   DBX_OUTPUT_MAIN_SOURCE_FILE_END (file, filename);
@@ -2190,7 +2190,7 @@ dbxout_symbol_name (decl, suffix, letter
 
 static void
 dbxout_prepare_symbol (decl)
-     tree decl;
+     tree decl ATTRIBUTE_UNUSED;
 {
 #ifdef WINNING_GDB
   char *filename = DECL_SOURCE_FILE (decl);
@@ -2683,7 +2683,7 @@ dbxout_really_begin_function (decl)
 
 void
 dbxout_begin_function (decl)
-     tree decl;
+     tree decl ATTRIBUTE_UNUSED;
 {
 #ifdef DBX_FUNCTION_FIRST
   dbxout_really_begin_function (decl);
diff -rup orig/egcs-CVS19990317/gcc/explow.c egcs-CVS19990317/gcc/explow.c
--- orig/egcs-CVS19990317/gcc/explow.c	Mon Feb 15 10:56:39 1999
+++ egcs-CVS19990317/gcc/explow.c	Thu Mar 18 11:31:28 1999
@@ -1468,7 +1468,7 @@ probe_stack_range (first, size)
 rtx
 hard_function_value (valtype, func)
      tree valtype;
-     tree func;
+     tree func ATTRIBUTE_UNUSED;
 {
   rtx val = FUNCTION_VALUE (valtype, func);
   if (GET_CODE (val) == REG
diff -rup orig/egcs-CVS19990317/gcc/expmed.c egcs-CVS19990317/gcc/expmed.c
--- orig/egcs-CVS19990317/gcc/expmed.c	Mon Feb 15 10:56:44 1999
+++ egcs-CVS19990317/gcc/expmed.c	Thu Mar 18 11:41:59 1999
@@ -3784,8 +3784,8 @@ expand_divmod (rem_flag, code, mode, op0
 		remainder = expand_binop (compute_mode, sub_optab, op0, tem,
 					  remainder, 0, OPTAB_LIB_WIDEN);
 	      }
-	    abs_rem = expand_abs (compute_mode, remainder, NULL_RTX, 0, 0);
-	    abs_op1 = expand_abs (compute_mode, op1, NULL_RTX, 0, 0);
+	    abs_rem = expand_abs (compute_mode, remainder, NULL_RTX, 0);
+	    abs_op1 = expand_abs (compute_mode, op1, NULL_RTX, 0);
 	    tem = expand_shift (LSHIFT_EXPR, compute_mode, abs_rem,
 				build_int_2 (1, 0), NULL_RTX, 1);
 	    do_cmp_and_jump (tem, abs_op1, LTU, compute_mode, label);
diff -rup orig/egcs-CVS19990317/gcc/expr.c egcs-CVS19990317/gcc/expr.c
--- orig/egcs-CVS19990317/gcc/expr.c	Fri Mar 12 19:23:54 1999
+++ egcs-CVS19990317/gcc/expr.c	Thu Mar 18 11:37:13 1999
@@ -7205,7 +7205,7 @@ expand_expr (exp, target, tmode, modifie
       if (TREE_UNSIGNED (type))
 	return op0;
 
-      return expand_abs (mode, op0, target, unsignedp,
+      return expand_abs (mode, op0, target,
 			 safe_from_p (target, TREE_OPERAND (exp, 0), 1));
 
     case MAX_EXPR:
diff -rup orig/egcs-CVS19990317/gcc/expr.h egcs-CVS19990317/gcc/expr.h
--- orig/egcs-CVS19990317/gcc/expr.h	Thu Feb 25 23:18:11 1999
+++ egcs-CVS19990317/gcc/expr.h	Thu Mar 18 11:37:23 1999
@@ -599,7 +599,7 @@ extern int expand_twoval_binop PROTO((op
 extern rtx expand_unop PROTO((enum machine_mode, optab, rtx, rtx, int));
 
 /* Expand the absolute value operation.  */
-extern rtx expand_abs PROTO((enum machine_mode, rtx, rtx, int, int));
+extern rtx expand_abs PROTO((enum machine_mode, rtx, rtx, int));
 
 /* Expand the complex absolute value operation.  */
 extern rtx expand_complex_abs PROTO((enum machine_mode, rtx, rtx, int));
diff -rup orig/egcs-CVS19990317/gcc/function.c egcs-CVS19990317/gcc/function.c
--- orig/egcs-CVS19990317/gcc/function.c	Fri Mar  5 09:50:44 1999
+++ egcs-CVS19990317/gcc/function.c	Thu Mar 18 11:28:12 1999
@@ -4934,7 +4934,7 @@ locate_and_pad_parm (passed_mode, type, 
      enum machine_mode passed_mode;
      tree type;
      int in_regs;
-     tree fndecl;
+     tree fndecl ATTRIBUTE_UNUSED;
      struct args_size *initial_offset_ptr;
      struct args_size *offset_ptr;
      struct args_size *arg_size_ptr;
diff -rup orig/egcs-CVS19990317/gcc/optabs.c egcs-CVS19990317/gcc/optabs.c
--- orig/egcs-CVS19990317/gcc/optabs.c	Sat Mar  6 08:00:07 1999
+++ egcs-CVS19990317/gcc/optabs.c	Thu Mar 18 11:46:07 1999
@@ -2109,14 +2109,13 @@ expand_unop (mode, unoptab, op0, target,
    MODE is the mode of the operand; the mode of the result is
    different but can be deduced from MODE.
 
-   UNSIGNEDP is relevant if extension is needed.  */
+ */
 
 rtx
-expand_abs (mode, op0, target, unsignedp, safe)
+expand_abs (mode, op0, target, safe)
      enum machine_mode mode;
      rtx op0;
      rtx target;
-     int unsignedp;
      int safe;
 {
   rtx temp, op1;
diff -rup orig/egcs-CVS19990317/gcc/sdbout.c egcs-CVS19990317/gcc/sdbout.c
--- orig/egcs-CVS19990317/gcc/sdbout.c	Thu Mar 11 09:27:33 1999
+++ egcs-CVS19990317/gcc/sdbout.c	Thu Mar 18 11:52:47 1999
@@ -338,7 +338,7 @@ void
 sdbout_init (asm_file, input_file_name, syms)
      FILE *asm_file;
      char *input_file_name;
-     tree syms;
+     tree syms ATTRIBUTE_UNUSED;
 {
 #ifdef MIPS_DEBUGGING_INFO
   current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
@@ -1561,7 +1561,7 @@ void
 sdbout_end_block (file, line, n)
      FILE *file;
      int line;
-     int n;
+     int n ATTRIBUTE_UNUSED;
 {
   MAKE_LINE_SAFE (line);
 
diff -rup orig/egcs-CVS19990317/gcc/toplev.c egcs-CVS19990317/gcc/toplev.c
--- orig/egcs-CVS19990317/gcc/toplev.c	Sun Mar 14 16:20:43 1999
+++ egcs-CVS19990317/gcc/toplev.c	Thu Mar 18 11:27:44 1999
@@ -5594,8 +5594,8 @@ debug_end_source_file (lineno)
 
 void
 debug_define (lineno, buffer)
-     register unsigned lineno;
-     register char *buffer;
+     register unsigned lineno ATTRIBUTE_UNUSED;
+     register char *buffer ATTRIBUTE_UNUSED;
 {
 #ifdef DWARF_DEBUGGING_INFO
   if (debug_info_level == DINFO_LEVEL_VERBOSE
@@ -5615,8 +5615,8 @@ debug_define (lineno, buffer)
 
 void
 debug_undef (lineno, buffer)
-     register unsigned lineno;
-     register char *buffer;
+     register unsigned lineno ATTRIBUTE_UNUSED;
+     register char *buffer ATTRIBUTE_UNUSED;
 {
 #ifdef DWARF_DEBUGGING_INFO
   if (debug_info_level == DINFO_LEVEL_VERBOSE
diff -rup orig/egcs-CVS19990317/gcc/varasm.c egcs-CVS19990317/gcc/varasm.c
--- orig/egcs-CVS19990317/gcc/varasm.c	Fri Feb 26 09:36:33 1999
+++ egcs-CVS19990317/gcc/varasm.c	Thu Mar 18 11:48:31 1999
@@ -264,7 +264,7 @@ void
 named_section (decl, name, reloc)
      tree decl;
      const char *name;
-     int reloc;
+     int reloc ATTRIBUTE_UNUSED;
 {
   if (decl != NULL_TREE
       && TREE_CODE_CLASS (TREE_CODE (decl)) != 'd')
@@ -1611,7 +1611,7 @@ contains_pointers_p (type)
 
 void
 assemble_external (decl)
-     tree decl;
+     tree decl ATTRIBUTE_UNUSED;
 {
 #ifdef ASM_OUTPUT_EXTERNAL
   if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd'
@@ -4336,7 +4336,7 @@ weak_finish ()
 
 void
 assemble_alias (decl, target)
-     tree decl, target;
+     tree decl, target ATTRIBUTE_UNUSED;
 {
   char *name;
 


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