This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Warnings removal
- To: egcs-patches at egcs dot cygnus dot com
- Subject: Warnings removal
- From: Marc Espie <espie at tetto dot liafa dot jussieu dot fr>
- Date: Tue, 31 Aug 1999 19:27:33 +0200
- Reply-To: Marc dot Espie at liafa dot jussieu dot fr
Mostly a no-brainer, just add prototypes and constify a few
char * to remove warnings.
The only one that may need some further patches is libgcc2.c.
I believe that most of the declarations in libgcc2.c should be
digged out of the #ifdef where they live.
Right now, that mammoth file defines lots of functions, but there
is no cross-checking, like __terminate proves.
For gcc:
Tue Aug 31 14:44:33 CEST 1999 Marc Espie <espie@cvs.openbsd.org>
* config/i386/i386.c (ix86_cpu_string, ix86_arch_string,
i386_reg_alloc_order, i386_regparm_string, i386_align_loops_string,
i386_align_jump_strings, i386_preferred_stack_boundary_string,
i386_branch_cost_string, i386_align_funcs_string): Constify.
* config/i386/i386.h (ix86_cpu_string, ix86_arch_string,
i386_reg_alloc_order, i386_regparm_string, i386_align_loops_string,
i386_align_jump_strings, i386_preferred_stack_boundary_string,
i386_branch_cost_string, i386_align_funcs_string): Likewise.
(optimization_options, arithmetic_comparison_operator,
ix86_logical_operator, asm_output_function_prefix, ix86_expand_prologue,
load_pic_register, ix86_compute_frame_size, ix86_expand_epilogue,
legitimate_pic_address_disp_p, x86_adjust_cost): Declare.
(OPTIMIZATION_OPTIONS): Reformat.
* final.c (output_addr_const): Replace fprintf with fputs.
* alias.c (non_local_reference_p): Constify.
* libgcc2.c (__terminate): Prototype.
For libiberty:
Tue Aug 31 14:44:33 CEST 1999 Marc Espie <espie@cvs.openbsd.org>
* cplus-dem.c (main): Constify.
--- gcc/config/i386/i386.c.orig Tue Aug 31 16:19:21 1999
+++ gcc/config/i386/i386.c Tue Aug 31 14:37:56 1999
@@ -182,15 +182,15 @@ enum processor_type ix86_cpu;
int ix86_arch;
/* Strings to hold which cpu and instruction set architecture to use. */
-char *ix86_cpu_string; /* for -mcpu=<xxx> */
-char *ix86_arch_string; /* for -march=<xxx> */
+const char *ix86_cpu_string; /* for -mcpu=<xxx> */
+const char *ix86_arch_string; /* for -march=<xxx> */
/* Register allocation order */
-char *i386_reg_alloc_order;
+const char *i386_reg_alloc_order;
static char regs_allocated[FIRST_PSEUDO_REGISTER];
/* # of registers to use to pass arguments. */
-char *i386_regparm_string;
+const char *i386_regparm_string;
/* i386_regparm_string as a number */
int i386_regparm;
@@ -198,24 +198,24 @@ int i386_regparm;
/* Alignment to use for loops and jumps: */
/* Power of two alignment for loops. */
-char *i386_align_loops_string;
+const char *i386_align_loops_string;
/* Power of two alignment for non-loop jumps. */
-char *i386_align_jumps_string;
+const char *i386_align_jumps_string;
/* Power of two alignment for stack boundary in bytes. */
-char *i386_preferred_stack_boundary_string;
+const char *i386_preferred_stack_boundary_string;
/* Preferred alignment for stack boundary in bits. */
int i386_preferred_stack_boundary;
/* Values 1-5: see jump.c */
int i386_branch_cost;
-char *i386_branch_cost_string;
+const char *i386_branch_cost_string;
/* Power of two alignment for functions. */
int i386_align_funcs;
-char *i386_align_funcs_string;
+const char *i386_align_funcs_string;
/* Power of two alignment for loops. */
int i386_align_loops;
--- gcc/config/i386/i386.h.orig Tue Aug 31 16:19:14 1999
+++ gcc/config/i386/i386.h Tue Aug 31 17:13:41 1999
@@ -286,7 +286,7 @@ extern int ix86_arch;
#define SUBTARGET_OPTIONS
/* Define this to change the optimizations performed by default. */
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
+#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options (LEVEL,SIZE)
/* Specs for the compiler proper */
@@ -2698,6 +2698,7 @@ do { \
/* Functions in i386.c */
extern void override_options ();
extern void order_regs_for_local_alloc ();
+extern void optimization_options ();
extern char *output_strlen_unroll ();
extern struct rtx_def *i386_sext16_if_const ();
extern int i386_aligned_p ();
@@ -2719,15 +2720,23 @@ extern char *output_move_const_single ()
extern int symbolic_operand ();
extern int call_insn_operand ();
extern int expander_call_insn_operand ();
+extern int arithmetic_comparison_operator ();
+extern int ix86_logical_operator ();
extern int symbolic_reference_mentioned_p ();
extern int ix86_expand_binary_operator ();
extern int ix86_binary_operator_ok ();
extern int ix86_expand_unary_operator ();
extern int ix86_unary_operator_ok ();
+extern void asm_output_function_prefix ();
extern void emit_pic_move ();
extern void function_prologue ();
+extern void ix86_expand_prologue ();
+extern void load_pic_register ();
+extern HOST_WIDE_INT ix86_compute_frame_size ();
extern int simple_386_epilogue ();
extern void function_epilogue ();
+extern void ix86_expand_epilogue ();
+extern int legitimate_pic_address_disp_p ();
extern int legitimate_address_p ();
extern struct rtx_def *legitimize_pic_address ();
extern struct rtx_def *legitimize_address ();
@@ -2762,6 +2771,7 @@ extern char *output_int_conditional_move
extern char *output_fp_conditional_move ();
extern int ix86_can_use_return_insn_p ();
extern int small_shift_operand ();
+extern int x86_adjust_cost ();
extern char *output_ashl ();
extern int memory_address_info ();
@@ -2771,15 +2781,16 @@ extern void rewrite_address ();
#endif
/* Variables in i386.c */
-extern char *ix86_cpu_string; /* for -mcpu=<xxx> */
-extern char *ix86_arch_string; /* for -march=<xxx> */
-extern char *i386_reg_alloc_order; /* register allocation order */
-extern char *i386_regparm_string; /* # registers to use to pass args */
-extern char *i386_align_loops_string; /* power of two alignment for loops */
-extern char *i386_align_jumps_string; /* power of two alignment for non-loop jumps */
-extern char *i386_align_funcs_string; /* power of two alignment for functions */
-extern char *i386_preferred_stack_boundary_string;/* power of two alignment for stack boundary */
-extern char *i386_branch_cost_string; /* values 1-5: see jump.c */
+extern const char *ix86_cpu_string; /* for -mcpu=<xxx> */
+extern const char *ix86_arch_string; /* for -march=<xxx> */
+extern const char *i386_reg_alloc_order; /* register allocation order */
+extern const char *i386_regparm_string; /* # registers to use to pass args */
+extern const char *i386_align_loops_string; /* power of two alignment for loops */
+extern const char *i386_align_jumps_string; /* power of two alignment for non-loop jumps */
+extern const char *i386_align_funcs_string; /* power of two alignment for functions */
+extern const char *i386_preferred_stack_boundary_string;
+ /* power of two alignment for stack boundary */
+extern const char *i386_branch_cost_string; /* values 1-5: see jump.c */
extern int i386_regparm; /* i386_regparm_string as a number */
extern int i386_align_loops; /* power of two alignment for loops */
extern int i386_align_jumps; /* power of two alignment for non-loop jumps */
--- gcc/final.c.orig Tue Aug 31 16:18:49 1999
+++ gcc/final.c Tue Aug 31 14:43:48 1999
@@ -3671,9 +3671,9 @@ output_addr_const (file, x)
if (GET_CODE (XEXP (x, 1)) == CONST_INT
&& INTVAL (XEXP (x, 1)) < 0)
{
- fprintf (file, ASM_OPEN_PAREN);
+ fputs (ASM_OPEN_PAREN, file);
output_addr_const (file, XEXP (x, 1));
- fprintf (file, ASM_CLOSE_PAREN);
+ fputs (ASM_CLOSE_PAREN, file);
}
else
output_addr_const (file, XEXP (x, 1));
--- gcc/alias.c.orig Tue Aug 31 16:45:26 1999
+++ gcc/alias.c Tue Aug 31 16:47:26 1999
@@ -1431,7 +1431,7 @@ nonlocal_reference_p (x)
/* Recursively scan the operands of this expression. */
{
- register char *fmt = GET_RTX_FORMAT (code);
+ register const char *fmt = GET_RTX_FORMAT (code);
register int i;
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
--- gcc/libgcc2.c.orig Tue Aug 31 17:05:00 1999
+++ gcc/libgcc2.c Tue Aug 31 17:09:44 1999
@@ -138,6 +138,8 @@ typedef union
DItype ll;
} DIunion;
+extern void __terminate (void);
+
#if (defined (L_udivmoddi4) || defined (L_muldi3) || defined (L_udiv_w_sdiv)\
|| defined (L_divdi3) || defined (L_udivdi3) \
|| defined (L_moddi3) || defined (L_umoddi3))
--- libiberty/cplus-dem.c.orig Tue Aug 31 17:30:43 1999
+++ libiberty/cplus-dem.c Tue Aug 31 17:30:52 1999
@@ -4451,7 +4451,7 @@ main (argc, argv)
{
char *result;
int c;
- char *valid_symbols;
+ const char *valid_symbols;
program_name = argv[0];