This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] tic4x warning fixups
- From: "Svein E. Seldal" <Svein dot Seldal at solidas dot com>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Sun, 15 Sep 2002 23:01:38 +0200
- Subject: [patch] tic4x warning fixups
Hello,
This is a patch for reducing the number of compiler warnings produced by
the tic4x target.
Svein
ChangeLog:
2002-09-15 Svein E. Seldal <Svein.Seldal@solidas.com>
* bfd/coff-tic4x.c: Added function declerations and ATTRIBUTE_USED flags.
* bfd/cpu-tic4x.c: Ditto
* gas/config/tc-tic4x.c: Ditto
? build
? build.tic54x
? patch
? tic4x_files.txt
? gas/testsuite/gas/tic4x
Index: bfd/coff-tic4x.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic4x.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 coff-tic4x.c
*** bfd/coff-tic4x.c 28 Aug 2002 10:38:44 -0000 1.1
--- bfd/coff-tic4x.c 15 Sep 2002 19:51:06 -0000
***************
*** 30,38 ****
#undef F_LSYMS
#define F_LSYMS F_LSYMS_TICOFF
static boolean
ticoff0_bad_format_hook (abfd, filehdr)
! bfd *abfd;
PTR filehdr;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
--- 30,48 ----
#undef F_LSYMS
#define F_LSYMS F_LSYMS_TICOFF
+ static boolean ticoff0_bad_format_hook PARAMS ((bfd *, PTR ));
+ static boolean ticoff1_bad_format_hook PARAMS ((bfd *, PTR ));
+ static boolean ticoff_bfd_is_local_label_name PARAMS ((bfd *, const char *));
+ static bfd_reloc_status_type tic4x_relocation PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char ** ));
+ static reloc_howto_type *tic4x_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type ));
+ static void tic4x_lookup_howto PARAMS ((arelent *, struct internal_reloc * ));
+ static reloc_howto_type *coff_tic4x_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma * ));
+ static void tic4x_reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection * ));
+
+
static boolean
ticoff0_bad_format_hook (abfd, filehdr)
! bfd *abfd ATTRIBUTE_UNUSED;
PTR filehdr;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
*************** ticoff_bfd_is_local_label_name (abfd, na
*** 69,77 ****
}
#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
-
- static void tic4x_reloc_processing
- PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
tic4x_reloc_processing (RELENT,RELOC,SYMS,ABFD,SECT)
--- 79,84 ----
Index: bfd/cpu-tic4x.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-tic4x.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 cpu-tic4x.c
*** bfd/cpu-tic4x.c 28 Aug 2002 10:38:45 -0000 1.1
--- bfd/cpu-tic4x.c 15 Sep 2002 19:51:06 -0000
***************
*** 23,28 ****
--- 23,31 ----
#include "sysdep.h"
#include "libbfd.h"
+ static boolean c4x_scan PARAMS ((const struct bfd_arch_info *, const char * ));
+
+
static boolean
c4x_scan (info, string)
const struct bfd_arch_info *info;
Index: gas/config/tc-tic4x.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-tic4x.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tc-tic4x.c
*** gas/config/tc-tic4x.c 28 Aug 2002 10:38:48 -0000 1.1
--- gas/config/tc-tic4x.c 15 Sep 2002 19:51:31 -0000
*************** extern FLONUM_TYPE generic_floating_poin
*** 203,208 ****
--- 204,212 ----
#define F_PRECISION (2) /* Float and double types 32-bit. */
#define GUARD (2)
+ /* Declare the function */
+ int c4x_gen_to_words PARAMS ((FLONUM_TYPE, LITTLENUM_TYPE *, int ));
+
/* Turn generic_floating_point_number into a real short/float/double. */
int
c4x_gen_to_words (FLONUM_TYPE flonum, LITTLENUM_TYPE *words, int precision)
*************** c4x_gen_to_words (FLONUM_TYPE flonum, LI
*** 465,470 ****
--- 469,477 ----
return return_value;
}
+ /* Function decleration */
+ char *c4x_atof PARAMS(( char *, char, LITTLENUM_TYPE * ));
+
/* Returns pointer past text consumed. */
char *
c4x_atof (char *str, char what_kind, LITTLENUM_TYPE *words)
*************** c4x_emit_char (char c)
*** 600,606 ****
}
static void
! c4x_seg_alloc (char *name, segT seg, int size, symbolS *symbolP)
{
/* Note that the size is in words
so we multiply it by 4 to get the number of bytes to allocate. */
--- 607,616 ----
}
static void
! c4x_seg_alloc (char *name ATTRIBUTE_UNUSED,
! segT seg ATTRIBUTE_UNUSED,
! int size,
! symbolS *symbolP)
{
/* Note that the size is in words
so we multiply it by 4 to get the number of bytes to allocate. */
*************** c4x_seg_alloc (char *name, segT seg, int
*** 622,628 ****
/* .asg ["]character-string["], symbol */
static void
! c4x_asg (int x)
{
char c;
char *name;
--- 632,638 ----
/* .asg ["]character-string["], symbol */
static void
! c4x_asg (int x ATTRIBUTE_UNUSED)
{
char c;
char *name;
*************** c4x_asg (int x)
*** 659,665 ****
/* .bss symbol, size */
static void
! c4x_bss (int x)
{
char c;
char *name;
--- 669,675 ----
/* .bss symbol, size */
static void
! c4x_bss (int x ATTRIBUTE_UNUSED)
{
char c;
char *name;
*************** c4x_bss (int x)
*** 713,719 ****
}
void
! c4x_globl (int ignore)
{
char *name;
int c;
--- 723,729 ----
}
void
! c4x_globl (int ignore ATTRIBUTE_UNUSED)
{
char *name;
int c;
*************** c4x_cons (int bytes)
*** 785,791 ****
/* .eval expression, symbol */
static void
! c4x_eval (int x)
{
char c;
int value;
--- 795,801 ----
/* .eval expression, symbol */
static void
! c4x_eval (int x ATTRIBUTE_UNUSED)
{
char c;
int value;
*************** c4x_eval (int x)
*** 807,813 ****
/* Reset local labels. */
static void
! c4x_newblock (int x)
{
dollar_label_clear ();
}
--- 817,823 ----
/* Reset local labels. */
static void
! c4x_newblock (int x ATTRIBUTE_UNUSED)
{
dollar_label_clear ();
}
*************** c4x_newblock (int x)
*** 815,821 ****
/* .sect "section-name" [, value] */
/* .sect ["]section-name[:subsection-name]["] [, value] */
static void
! c4x_sect (int x)
{
char c;
char *section_name;
--- 825,831 ----
/* .sect "section-name" [, value] */
/* .sect ["]section-name[:subsection-name]["] [, value] */
static void
! c4x_sect (int x ATTRIBUTE_UNUSED)
{
char c;
char *section_name;
*************** c4x_sect (int x)
*** 888,894 ****
/* symbol[:] .set value or .set symbol, value */
static void
! c4x_set (int x)
{
symbolS *symbolP;
--- 898,904 ----
/* symbol[:] .set value or .set symbol, value */
static void
! c4x_set (int x ATTRIBUTE_UNUSED)
{
symbolS *symbolP;
*************** c4x_set (int x)
*** 917,923 ****
/* [symbol] .usect ["]section-name["], size-in-words [, alignment-flag] */
static void
! c4x_usect (int x)
{
char c;
char *name;
--- 927,933 ----
/* [symbol] .usect ["]section-name["], size-in-words [, alignment-flag] */
static void
! c4x_usect (int x ATTRIBUTE_UNUSED)
{
char c;
char *name;
*************** c4x_usect (int x)
*** 983,989 ****
/* .version cpu-version. */
static void
! c4x_version (int x)
{
unsigned int temp;
--- 993,999 ----
/* .version cpu-version. */
static void
! c4x_version (int x ATTRIBUTE_UNUSED)
{
unsigned int temp;
*************** c4x_version (int x)
*** 1000,1006 ****
}
static void
! c4x_pseudo_ignore (int x)
{
/* We could print warning message here... */
--- 1010,1016 ----
}
static void
! c4x_pseudo_ignore (int x ATTRIBUTE_UNUSED)
{
/* We could print warning message here... */
*************** c4x_indirect_parse (c4x_operand_t *opera
*** 1338,1343 ****
--- 1348,1355 ----
return 1;
}
+ char *c4x_operand_parse PARAMS((char *, c4x_operand_t *));
+
char *
c4x_operand_parse (char *s, c4x_operand_t *operand)
{
*************** c4x_operands_match (c4x_inst_t *inst, c4
*** 2057,2062 ****
--- 2069,2076 ----
}
}
+ void c4x_insn_output PARAMS((c4x_insn_t *));
+
void
c4x_insn_output (c4x_insn_t *insn)
{
*************** c4x_insn_output (c4x_insn_t *insn)
*** 2081,2086 ****
--- 2095,2103 ----
}
}
+ /* Function decleration */
+ int c4x_operands_parse PARAMS((char *, c4x_operand_t *, int ));
+
/* Parse the operands. */
int
c4x_operands_parse (char *s, c4x_operand_t *operands, int num_operands)
*************** md_apply_fix3 (fixS *fixP, valueT *value
*** 2319,2348 ****
/* Should never be called for c4x. */
void
! md_convert_frag (bfd *headers, segT sec, fragS *fragP)
{
as_fatal ("md_convert_frag");
}
/* Should never be called for c4x. */
void
! md_create_short_jump (char *ptr, addressT from_addr, addressT to_addr,
! fragS *frag, symbolS *to_symbol)
{
as_fatal ("md_create_short_jmp\n");
}
/* Should never be called for c4x. */
void
! md_create_long_jump (char *ptr, addressT from_addr, addressT to_addr,
! fragS *frag, symbolS *to_symbol)
{
as_fatal ("md_create_long_jump\n");
}
/* Should never be called for c4x. */
int
! md_estimate_size_before_relax (register fragS *fragP, segT segtype)
{
as_fatal ("md_estimate_size_before_relax\n");
return 0;
--- 2336,2374 ----
/* Should never be called for c4x. */
void
! md_convert_frag (bfd *headers ATTRIBUTE_UNUSED,
! segT sec ATTRIBUTE_UNUSED,
! fragS *fragP ATTRIBUTE_UNUSED)
{
as_fatal ("md_convert_frag");
}
/* Should never be called for c4x. */
void
! md_create_short_jump (char *ptr ATTRIBUTE_UNUSED,
! addressT from_addr ATTRIBUTE_UNUSED,
! addressT to_addr ATTRIBUTE_UNUSED,
! fragS *frag ATTRIBUTE_UNUSED,
! symbolS *to_symbol ATTRIBUTE_UNUSED)
{
as_fatal ("md_create_short_jmp\n");
}
/* Should never be called for c4x. */
void
! md_create_long_jump (char *ptr ATTRIBUTE_UNUSED,
! addressT from_addr ATTRIBUTE_UNUSED,
! addressT to_addr ATTRIBUTE_UNUSED,
! fragS *frag ATTRIBUTE_UNUSED,
! symbolS *to_symbol ATTRIBUTE_UNUSED)
{
as_fatal ("md_create_long_jump\n");
}
/* Should never be called for c4x. */
int
! md_estimate_size_before_relax (register fragS *fragP ATTRIBUTE_UNUSED,
! segT segtype ATTRIBUTE_UNUSED)
{
as_fatal ("md_estimate_size_before_relax\n");
return 0;
*************** md_undefined_symbol (char *name)
*** 2468,2482 ****
return NULL;
}
/* Parse an operand that is machine-specific. */
void
! md_operand (expressionS *expressionP)
{
}
/* Round up a section size to the appropriate boundary---do we need this? */
valueT
! md_section_align (segT segment, valueT size)
{
return size; /* Byte (i.e., 32-bit) alignment is fine? */
}
--- 2494,2511 ----
return NULL;
}
+ /* Function decleration */
+ void md_operand PARAMS((expressionS * ));
+
/* Parse an operand that is machine-specific. */
void
! md_operand (expressionS *expressionP ATTRIBUTE_UNUSED)
{
}
/* Round up a section size to the appropriate boundary---do we need this? */
valueT
! md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
{
return size; /* Byte (i.e., 32-bit) alignment is fine? */
}
*************** md_pcrel_from (fixS *fixP)
*** 2558,2564 ****
/* This is probably not necessary, if we have played our cards right,
since everything should be already aligned on a 4-byte boundary. */
int
! c4x_do_align (int alignment, const char *fill, int len, int max)
{
char *p;
--- 2587,2596 ----
/* This is probably not necessary, if we have played our cards right,
since everything should be already aligned on a 4-byte boundary. */
int
! c4x_do_align (int alignment ATTRIBUTE_UNUSED,
! const char *fill ATTRIBUTE_UNUSED,
! int len ATTRIBUTE_UNUSED,
! int max ATTRIBUTE_UNUSED)
{
char *p;
*************** c4x_start_line (void)
*** 2598,2604 ****
}
arelent *
! tc_gen_reloc (asection *seg, fixS *fixP)
{
arelent *reloc;
--- 2630,2637 ----
}
arelent *
! tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixP)
{
arelent *reloc;