merge from gcc
[external/binutils.git] / gas / ecoff.c
index f04e530..f4e22ac 100644 (file)
@@ -1,5 +1,7 @@
 /* ECOFF debugging support.
-   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    This file was put together by Ian Lance Taylor <ian@cygnus.com>.  A
    good deal of it comes directly from mips-tfile.c, by Michael
@@ -9,7 +11,7 @@
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -19,8 +21,8 @@
 
    You should have received a copy of the GNU General Public License
    along with GAS; see the file COPYING.  If not, write to the Free
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 #include "as.h"
 
@@ -36,7 +38,7 @@
 #include "coff/symconst.h"
 #include "aout/stab_gnu.h"
 
-#include <ctype.h>
+#include "safe-ctype.h"
 
 /* Why isn't this in coff/sym.h?  */
 #define ST_RFDESCAPE 0xfff
@@ -1407,76 +1409,74 @@ static char stabs_symbol[] = STABS_SYMBOL;
 \f
 /* Prototypes for functions defined in this file.  */
 
-static void add_varray_page PARAMS ((varray_t *vp));
-static symint_t add_string PARAMS ((varray_t *vp,
-                                   struct hash_control *hash_tbl,
-                                   const char *str,
-                                   shash_t **ret_hash));
-static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type,
-                                            sc_t storage, symbolS *sym,
-                                            bfd_vma addend, symint_t value,
-                                            symint_t indx));
-static symint_t add_aux_sym_symint PARAMS ((symint_t aux_word));
-static symint_t add_aux_sym_rndx PARAMS ((int file_index,
-                                         symint_t sym_index));
-static symint_t add_aux_sym_tir PARAMS ((type_info_t *t,
-                                        hash_state_t state,
-                                        thash_t **hash_tbl));
-static tag_t *get_tag PARAMS ((const char *tag, localsym_t *sym,
-                              bt_t basic_type));
-static void add_unknown_tag PARAMS ((tag_t *ptag));
-static void add_procedure PARAMS ((char *func));
-static void add_file PARAMS ((const char *file_name, int indx, int fake));
+static void add_varray_page (varray_t *vp);
+static symint_t add_string (varray_t *vp,
+                           struct hash_control *hash_tbl,
+                           const char *str,
+                           shash_t **ret_hash);
+static localsym_t *add_ecoff_symbol (const char *str, st_t type,
+                                    sc_t storage, symbolS *sym,
+                                    bfd_vma addend, symint_t value,
+                                    symint_t indx);
+static symint_t add_aux_sym_symint (symint_t aux_word);
+static symint_t add_aux_sym_rndx (int file_index, symint_t sym_index);
+static symint_t add_aux_sym_tir (type_info_t *t,
+                                hash_state_t state,
+                                thash_t **hash_tbl);
+static tag_t *get_tag (const char *tag, localsym_t *sym, bt_t basic_type);
+static void add_unknown_tag (tag_t *ptag);
+static void add_procedure (char *func);
+static void add_file (const char *file_name, int indx, int fake);
 #ifdef ECOFF_DEBUG
-static char *sc_to_string PARAMS ((sc_t storage_class));
-static char *st_to_string PARAMS ((st_t symbol_type));
+static char *sc_to_string (sc_t storage_class);
+static char *st_to_string (st_t symbol_type);
 #endif
-static void mark_stabs PARAMS ((int));
-static char *ecoff_add_bytes PARAMS ((char **buf, char **bufend,
-                                     char *bufptr, unsigned long need));
+static void mark_stabs (int);
+static char *ecoff_add_bytes (char **buf, char **bufend,
+                             char *bufptr, unsigned long need);
 static unsigned long ecoff_padding_adjust
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset, char **bufptrptr));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset, char **bufptrptr);
 static unsigned long ecoff_build_lineno
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset, long *linecntptr));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset, long *linecntptr);
 static unsigned long ecoff_build_symbols
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
 static unsigned long ecoff_build_procs
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
 static unsigned long ecoff_build_aux
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
-static unsigned long ecoff_build_strings PARAMS ((char **buf, char **bufend,
-                                                 unsigned long offset,
-                                                 varray_t *vp));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
+static unsigned long ecoff_build_strings (char **buf, char **bufend,
+                                         unsigned long offset,
+                                         varray_t *vp);
 static unsigned long ecoff_build_ss
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
 static unsigned long ecoff_build_fdr
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
-static void ecoff_setup_ext PARAMS ((void));
-static page_type *allocate_cluster PARAMS ((unsigned long npages));
-static page_type *allocate_page PARAMS ((void));
-static scope_t *allocate_scope PARAMS ((void));
-static void free_scope PARAMS ((scope_t *ptr));
-static vlinks_t *allocate_vlinks PARAMS ((void));
-static shash_t *allocate_shash PARAMS ((void));
-static thash_t *allocate_thash PARAMS ((void));
-static tag_t *allocate_tag PARAMS ((void));
-static void free_tag PARAMS ((tag_t *ptr));
-static forward_t *allocate_forward PARAMS ((void));
-static thead_t *allocate_thead PARAMS ((void));
-static void free_thead PARAMS ((thead_t *ptr));
-static lineno_list_t *allocate_lineno_list PARAMS ((void));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
+static void ecoff_setup_ext (void);
+static page_type *allocate_cluster (unsigned long npages);
+static page_type *allocate_page (void);
+static scope_t *allocate_scope (void);
+static void free_scope (scope_t *ptr);
+static vlinks_t *allocate_vlinks (void);
+static shash_t *allocate_shash (void);
+static thash_t *allocate_thash (void);
+static tag_t *allocate_tag (void);
+static void free_tag (tag_t *ptr);
+static forward_t *allocate_forward (void);
+static thead_t *allocate_thead (void);
+static void free_thead (thead_t *ptr);
+static lineno_list_t *allocate_lineno_list (void);
 \f
 /* This function should be called when the assembler starts up.  */
 
 void
-ecoff_read_begin_hook ()
+ecoff_read_begin_hook (void)
 {
   tag_hash = hash_new ();
   top_tag_head = allocate_thead ();
@@ -1489,8 +1489,7 @@ ecoff_read_begin_hook ()
 /* This function should be called when a symbol is created.  */
 
 void
-ecoff_symbol_new_hook (symbolP)
-     symbolS *symbolP;
+ecoff_symbol_new_hook (symbolS *symbolP)
 {
   OBJ_SYMFIELD_TYPE *obj;
 
@@ -1507,12 +1506,21 @@ ecoff_symbol_new_hook (symbolP)
   obj->ecoff_symbol = NULL;
   obj->ecoff_extern_size = 0;
 }
+
+void
+ecoff_symbol_clone_hook (symbolS *newsymP, symbolS *orgsymP)
+{
+  OBJ_SYMFIELD_TYPE *n, *o;
+
+  n = symbol_get_obj (newsymP);
+  o = symbol_get_obj (orgsymP);
+  memcpy (n, o, sizeof *n);
+}
 \f
 /* Add a page to a varray object.  */
 
 static void
-add_varray_page (vp)
-     varray_t *vp;                             /* varray to add page to */
+add_varray_page (varray_t *vp /* varray to add page to */)
 {
   vlinks_t *new_links = allocate_vlinks ();
 
@@ -1542,17 +1550,16 @@ add_varray_page (vp)
 /* Add a string (and null pad) to one of the string tables.  */
 
 static symint_t
-add_string (vp, hash_tbl, str, ret_hash)
-     varray_t *vp;                     /* string obstack */
-     struct hash_control *hash_tbl;    /* ptr to hash table */
-     const char *str;                  /* string */
-     shash_t **ret_hash;               /* return hash pointer */
+add_string (varray_t *vp,                      /* string obstack */
+           struct hash_control *hash_tbl,      /* ptr to hash table */
+           const char *str,                    /* string */
+           shash_t **ret_hash                  /* return hash pointer */)
 {
   register unsigned long len = strlen (str);
   register shash_t *hash_ptr;
 
   if (len >= PAGE_USIZE)
-    as_fatal (_("String too big (%lu bytes)"), len);
+    as_fatal (_("string too big (%lu bytes)"), len);
 
   hash_ptr = (shash_t *) hash_find (hash_tbl, str);
   if (hash_ptr == (shash_t *) NULL)
@@ -1578,7 +1585,7 @@ add_string (vp, hash_tbl, str, ret_hash)
 
       err = hash_insert (hash_tbl, str, (char *) hash_ptr);
       if (err)
-       as_fatal (_("Inserting \"%s\" into string hash table: %s"),
+       as_fatal (_("inserting \"%s\" into string hash table: %s"),
                  str, err);
     }
 
@@ -1591,14 +1598,13 @@ add_string (vp, hash_tbl, str, ret_hash)
 /* Add debugging information for a symbol.  */
 
 static localsym_t *
-add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
-     const char *str;                  /* symbol name */
-     st_t type;                                /* symbol type */
-     sc_t storage;                     /* storage class */
-     symbolS *sym_value;               /* associated symbol.  */
-     bfd_vma addend;                   /* addend to sym_value.  */
-     symint_t value;                   /* value of symbol */
-     symint_t indx;                    /* index to local/aux. syms */
+add_ecoff_symbol (const char *str,     /* symbol name */
+                 st_t type,            /* symbol type */
+                 sc_t storage,         /* storage class */
+                 symbolS *sym_value,   /* associated symbol.  */
+                 bfd_vma addend,       /* addend to sym_value.  */
+                 symint_t value,       /* value of symbol */
+                 symint_t indx         /* index to local/aux. syms */)
 {
   localsym_t *psym;
   register scope_t *pscope;
@@ -1797,8 +1803,7 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
    for integral aux types, not just symints.  */
 
 static symint_t
-add_aux_sym_symint (aux_word)
-     symint_t aux_word;                /* auxiliary information word */
+add_aux_sym_symint (symint_t aux_word /* auxiliary information word */)
 {
   register varray_t *vp;
   register aux_t *aux_ptr;
@@ -1821,9 +1826,7 @@ add_aux_sym_symint (aux_word)
 /* Add an auxiliary symbol (passing a file/symbol index combo).  */
 
 static symint_t
-add_aux_sym_rndx (file_index, sym_index)
-     int file_index;
-     symint_t sym_index;
+add_aux_sym_rndx (int file_index, symint_t sym_index)
 {
   register varray_t *vp;
   register aux_t *aux_ptr;
@@ -1848,10 +1851,9 @@ add_aux_sym_rndx (file_index, sym_index)
    type qualifiers).  */
 
 static symint_t
-add_aux_sym_tir (t, state, hash_tbl)
-     type_info_t *t;           /* current type information */
-     hash_state_t state;       /* whether to hash type or not */
-     thash_t **hash_tbl;       /* pointer to hash table to use */
+add_aux_sym_tir (type_info_t *t,       /* current type information */
+                hash_state_t state,    /* whether to hash type or not */
+                thash_t **hash_tbl     /* pointer to hash table to use */)
 {
   register varray_t *vp;
   register aux_t *aux_ptr;
@@ -2005,10 +2007,9 @@ add_aux_sym_tir (t, state, hash_tbl)
 /* Add a tag to the tag table (unless it already exists).  */
 
 static tag_t *
-get_tag (tag, sym, basic_type)
-     const char *tag;                  /* tag name */
-     localsym_t *sym;                  /* tag start block */
-     bt_t basic_type;                  /* bt_Struct, bt_Union, or bt_Enum */
+get_tag (const char *tag,      /* tag name */
+        localsym_t *sym,       /* tag start block */
+        bt_t basic_type        /* bt_Struct, bt_Union, or bt_Enum */)
 {
   shash_t *hash_ptr;
   const char *err;
@@ -2036,12 +2037,11 @@ get_tag (tag, sym, basic_type)
     {
       char *perm;
 
-      perm = xmalloc ((unsigned long) (strlen (tag) + 1));
-      strcpy (perm, tag);
+      perm = xstrdup (tag);
       hash_ptr = allocate_shash ();
       err = hash_insert (tag_hash, perm, (char *) hash_ptr);
       if (err)
-       as_fatal (_("Inserting \"%s\" into tag hash table: %s"),
+       as_fatal (_("inserting \"%s\" into tag hash table: %s"),
                  tag, err);
       hash_ptr->string = perm;
     }
@@ -2066,8 +2066,7 @@ get_tag (tag, sym, basic_type)
 /* Add an unknown {struct, union, enum} tag.  */
 
 static void
-add_unknown_tag (ptag)
-     tag_t *ptag;              /* pointer to tag information */
+add_unknown_tag (tag_t *ptag /* pointer to tag information */)
 {
   shash_t *hash_ptr    = ptag->hash_ptr;
   char *name           = hash_ptr->string;
@@ -2116,8 +2115,7 @@ add_unknown_tag (ptag)
    this is the current procedure.  */
 
 static void
-add_procedure (func)
-     char *func;                       /* func name */
+add_procedure (char *func /* func name */)
 {
   register varray_t *vp;
   register proc_t *new_proc_ptr;
@@ -2177,7 +2175,7 @@ add_procedure (func)
 }
 
 symbolS *
-ecoff_get_cur_proc_sym ()
+ecoff_get_cur_proc_sym (void)
 {
   return (cur_proc_ptr ? cur_proc_ptr->sym->as_sym : NULL);
 }
@@ -2187,10 +2185,7 @@ ecoff_get_cur_proc_sym ()
    where the current file structure lives.  */
 
 static void
-add_file (file_name, indx, fake)
-     const char *file_name;            /* file name */
-     int indx;
-     int fake;
+add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
 {
   register int first_ch;
   register efdr_t *fil_ptr;
@@ -2219,7 +2214,7 @@ add_file (file_name, indx, fake)
       if (! symbol_table_frozen && debug_type == DEBUG_UNSPECIFIED)
        debug_type = DEBUG_ECOFF;
     }
-  else
+  else if (debug_type == DEBUG_UNSPECIFIED)
     debug_type = DEBUG_NONE;
 
 #ifndef NO_LISTING
@@ -2297,7 +2292,7 @@ add_file (file_name, indx, fake)
                  (shash_t **)0);
 
       if (strlen (file_name) > PAGE_USIZE - 2)
-       as_fatal (_("Filename goes over one page boundary."));
+       as_fatal (_("filename goes over one page boundary"));
 
       /* Push the start of the filename. We assume that the filename
          will be stored at string offset 1.  */
@@ -2328,8 +2323,7 @@ add_file (file_name, indx, fake)
    compiler output, only in hand coded assembler.  */
 
 void
-ecoff_new_file (name)
-     const char *name;
+ecoff_new_file (const char *name, int appfile ATTRIBUTE_UNUSED)
 {
   if (cur_file_ptr != NULL && strcmp (cur_file_ptr->name, name) == 0)
     return;
@@ -2424,8 +2418,7 @@ st_to_string (symbol_type)
    which gives the location of the start of the block.  */
 
 void
-ecoff_directive_begin (ignore)
-     int ignore;
+ecoff_directive_begin (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
@@ -2462,8 +2455,7 @@ ecoff_directive_begin (ignore)
    which gives the location of the end of the block.  */
 
 void
-ecoff_directive_bend (ignore)
-     int ignore;
+ecoff_directive_bend (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
@@ -2521,8 +2513,7 @@ static int coff_inside_enumeration;
 /* Handle a .def directive: start defining a symbol.  */
 
 void
-ecoff_directive_def (ignore)
-     int ignore;
+ecoff_directive_def (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
@@ -2537,15 +2528,15 @@ ecoff_directive_def (ignore)
   if (coff_sym_name != (char *) NULL)
     as_warn (_(".def pseudo-op used inside of .def/.endef; ignored"));
   else if (*name == '\0')
-    as_warn (_("Empty symbol name in .def; ignored"));
+    as_warn (_("empty symbol name in .def; ignored"));
   else
     {
       if (coff_sym_name != (char *) NULL)
        free (coff_sym_name);
       if (coff_tag != (char *) NULL)
        free (coff_tag);
-      coff_sym_name = (char *) xmalloc ((unsigned long) (strlen (name) + 1));
-      strcpy (coff_sym_name, name);
+      
+      coff_sym_name = xstrdup (name);
       coff_type = type_info_init;
       coff_storage_class = sc_Nil;
       coff_symbol_typ = st_Nil;
@@ -2567,8 +2558,7 @@ ecoff_directive_def (ignore)
    more than that anyhow, so I will also make that assumption.  */
 
 void
-ecoff_directive_dim (ignore)
-     int ignore;
+ecoff_directive_dim (int ignore ATTRIBUTE_UNUSED)
 {
   int dimens[N_TQ];
   int i;
@@ -2590,7 +2580,7 @@ ecoff_directive_dim (ignore)
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
-           as_warn (_("Badly formed .dim directive"));
+           as_warn (_("badly formed .dim directive"));
          break;
        }
     }
@@ -2603,7 +2593,7 @@ ecoff_directive_dim (ignore)
     {
       if (coff_type.num_dims >= N_TQ)
        {
-         as_warn (_("Too many .dim entries"));
+         as_warn (_("too many .dim entries"));
          break;
        }
       coff_type.dimensions[coff_type.num_dims] = dimens[i];
@@ -2617,8 +2607,7 @@ ecoff_directive_dim (ignore)
    symbol.  */
 
 void
-ecoff_directive_scl (ignore)
-     int ignore;
+ecoff_directive_scl (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
@@ -2642,8 +2631,7 @@ ecoff_directive_scl (ignore)
    never generate more than one argument.  */
 
 void
-ecoff_directive_size (ignore)
-     int ignore;
+ecoff_directive_size (int ignore ATTRIBUTE_UNUSED)
 {
   int sizes[N_TQ];
   int i;
@@ -2665,7 +2653,7 @@ ecoff_directive_size (ignore)
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
-           as_warn (_("Badly formed .size directive"));
+           as_warn (_("badly formed .size directive"));
          break;
        }
     }
@@ -2678,7 +2666,7 @@ ecoff_directive_size (ignore)
     {
       if (coff_type.num_sizes >= N_TQ)
        {
-         as_warn (_("Too many .size entries"));
+         as_warn (_("too many .size entries"));
          break;
        }
       coff_type.sizes[coff_type.num_sizes] = sizes[i];
@@ -2692,8 +2680,7 @@ ecoff_directive_size (ignore)
    symbol.  */
 
 void
-ecoff_directive_type (ignore)
-     int ignore;
+ecoff_directive_type (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
   tq_t *tq_ptr;
@@ -2719,7 +2706,7 @@ ecoff_directive_type (ignore)
          /* FIXME: We could handle this by setting the continued bit.
             There would still be a limit: the .type argument can not
             be infinite.  */
-         as_warn (_("The type of %s is too complex; it will be simplified"),
+         as_warn (_("the type of %s is too complex; it will be simplified"),
                   coff_sym_name);
          break;
        }
@@ -2761,8 +2748,7 @@ ecoff_directive_type (ignore)
    union or enum.  */
 
 void
-ecoff_directive_tag (ignore)
-     int ignore;
+ecoff_directive_tag (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
@@ -2777,8 +2763,7 @@ ecoff_directive_tag (ignore)
   name = input_line_pointer;
   name_end = get_symbol_end ();
 
-  coff_tag = (char *) xmalloc ((unsigned long) (strlen (name) + 1));
-  strcpy (coff_tag, name);
+  coff_tag = xstrdup (name);
 
   *input_line_pointer = name_end;
 
@@ -2789,8 +2774,7 @@ ecoff_directive_tag (ignore)
    may be the name of a static or global symbol.  */
 
 void
-ecoff_directive_val (ignore)
-     int ignore;
+ecoff_directive_val (int ignore ATTRIBUTE_UNUSED)
 {
   expressionS exp;
 
@@ -2804,7 +2788,7 @@ ecoff_directive_val (ignore)
   expression (&exp);
   if (exp.X_op != O_constant && exp.X_op != O_symbol)
     {
-      as_bad (_(".val expression is too copmlex"));
+      as_bad (_(".val expression is too complex"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2824,8 +2808,7 @@ ecoff_directive_val (ignore)
    debugging information for a symbol.  */
 
 void
-ecoff_directive_endef (ignore)
-     int ignore;
+ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   symint_t indx;
@@ -2861,7 +2844,7 @@ ecoff_directive_endef (ignore)
 
       if (coff_type.num_sizes != 1 || diff < 0)
        {
-         as_warn (_("Bad COFF debugging info"));
+         as_warn (_("bad COFF debugging information"));
          return;
        }
 
@@ -2891,7 +2874,7 @@ ecoff_directive_endef (ignore)
   else if (coff_symbol_typ == st_Member
           && coff_type.num_sizes - coff_type.extra_sizes == 1)
     {
-      /* Is this a bitfield?  This is indicated by a structure memeber
+      /* Is this a bitfield?  This is indicated by a structure member
          having a size field that isn't an array.  */
       coff_type.bitfield = 1;
     }
@@ -2910,7 +2893,7 @@ ecoff_directive_endef (ignore)
        {
          if (coff_tag == (char *) NULL)
            {
-             as_warn (_("No tag specified for %s"), name);
+             as_warn (_("no tag specified for %s"), name);
              return;
            }
 
@@ -2942,7 +2925,7 @@ ecoff_directive_endef (ignore)
       if (coff_type.num_sizes - coff_type.num_dims - coff_type.extra_sizes
          != 1)
        {
-         as_warn (_("Bad COFF debugging information"));
+         as_warn (_("bad COFF debugging information"));
          return;
        }
       else
@@ -3004,12 +2987,10 @@ ecoff_directive_endef (ignore)
 /* Parse .end directives.  */
 
 void
-ecoff_directive_end (ignore)
-     int ignore;
+ecoff_directive_end (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
-  register int ch;
   symbolS *ent;
 
   if (cur_file_ptr == (efdr_t *) NULL)
@@ -3029,8 +3010,7 @@ ecoff_directive_end (ignore)
   name = input_line_pointer;
   name_end = get_symbol_end ();
 
-  ch = *name;
-  if (! is_name_beginner (ch))
+  if (name == input_line_pointer)
     {
       as_warn (_(".end directive has no name"));
       *input_line_pointer = name_end;
@@ -3061,12 +3041,10 @@ ecoff_directive_end (ignore)
 /* Parse .ent directives.  */
 
 void
-ecoff_directive_ent (ignore)
-     int ignore;
+ecoff_directive_ent (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
-  register int ch;
 
   if (cur_file_ptr == (efdr_t *) NULL)
     add_file ((const char *) NULL, 0, 1);
@@ -3081,8 +3059,7 @@ ecoff_directive_ent (ignore)
   name = input_line_pointer;
   name_end = get_symbol_end ();
 
-  ch = *name;
-  if (! is_name_beginner (ch))
+  if (name == input_line_pointer)
     {
       as_warn (_(".ent directive has no name"));
       *input_line_pointer = name_end;
@@ -3104,7 +3081,7 @@ ecoff_directive_ent (ignore)
       ++input_line_pointer;
       SKIP_WHITESPACE ();
     }
-  if (isdigit ((unsigned char) *input_line_pointer)
+  if (ISDIGIT (*input_line_pointer)
       || *input_line_pointer == '-')
     (void) get_absolute_expression ();
 
@@ -3114,8 +3091,7 @@ ecoff_directive_ent (ignore)
 /* Parse .extern directives.  */
 
 void
-ecoff_directive_extern (ignore)
-     int ignore;
+ecoff_directive_extern (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   int c;
@@ -3139,8 +3115,7 @@ ecoff_directive_extern (ignore)
 /* Parse .file directives.  */
 
 void
-ecoff_directive_file (ignore)
-     int ignore;
+ecoff_directive_file (int ignore ATTRIBUTE_UNUSED)
 {
   int indx;
   char *name;
@@ -3148,7 +3123,7 @@ ecoff_directive_file (ignore)
 
   if (cur_proc_ptr != (proc_t *) NULL)
     {
-      as_warn (_("No way to handle .file within .ent/.end section"));
+      as_warn (_("no way to handle .file within .ent/.end section"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -3166,8 +3141,7 @@ ecoff_directive_file (ignore)
 /* Parse .fmask directives.  */
 
 void
-ecoff_directive_fmask (ignore)
-     int ignore;
+ecoff_directive_fmask (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
@@ -3180,7 +3154,7 @@ ecoff_directive_fmask (ignore)
 
   if (get_absolute_expression_and_terminator (&val) != ',')
     {
-      as_warn (_("Bad .fmask directive"));
+      as_warn (_("bad .fmask directive"));
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3195,8 +3169,7 @@ ecoff_directive_fmask (ignore)
 /* Parse .frame directives.  */
 
 void
-ecoff_directive_frame (ignore)
-     int ignore;
+ecoff_directive_frame (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
@@ -3213,7 +3186,7 @@ ecoff_directive_frame (ignore)
   if (*input_line_pointer++ != ','
       || get_absolute_expression_and_terminator (&val) != ',')
     {
-      as_warn (_("Bad .frame directive"));
+      as_warn (_("bad .frame directive"));
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3223,21 +3196,16 @@ ecoff_directive_frame (ignore)
 
   cur_proc_ptr->pdr.pcreg = tc_get_register (0);
 
-#if 0
   /* Alpha-OSF1 adds "the offset of saved $a0 from $sp", according to
      Sandro.  I don't yet know where this value should be stored, if
-     anywhere.  */
-  demand_empty_rest_of_line ();
-#else
+     anywhere.  Don't call demand_empty_rest_of_line ().  */
   s_ignore (42);
-#endif
 }
 \f
 /* Parse .mask directives.  */
 
 void
-ecoff_directive_mask (ignore)
-     int ignore;
+ecoff_directive_mask (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
@@ -3250,7 +3218,7 @@ ecoff_directive_mask (ignore)
 
   if (get_absolute_expression_and_terminator (&val) != ',')
     {
-      as_warn (_("Bad .mask directive"));
+      as_warn (_("bad .mask directive"));
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3265,8 +3233,7 @@ ecoff_directive_mask (ignore)
 /* Parse .loc directives.  */
 
 void
-ecoff_directive_loc (ignore)
-     int ignore;
+ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED)
 {
   lineno_list_t *list;
   symint_t lineno;
@@ -3346,9 +3313,7 @@ ecoff_directive_loc (ignore)
    information so that it points to the instruction after the nop.  */
 
 void
-ecoff_fix_loc (old_frag, old_frag_offset)
-     fragS *old_frag;
-     unsigned long old_frag_offset;
+ecoff_fix_loc (fragS *old_frag, unsigned long old_frag_offset)
 {
   if (last_lineno != NULL
       && last_lineno->frag == old_frag
@@ -3362,14 +3327,13 @@ ecoff_fix_loc (old_frag, old_frag_offset)
 /* Make sure the @stabs symbol is emitted.  */
 
 static void
-mark_stabs (ignore)
-     int ignore;
+mark_stabs (int ignore ATTRIBUTE_UNUSED)
 {
   if (! stabs_seen)
     {
       /* Add a dummy @stabs dymbol.  */
       stabs_seen = 1;
-      (void) add_ecoff_symbol (stabs_symbol, stNil, scInfo,
+      (void) add_ecoff_symbol (stabs_symbol, st_Nil, sc_Info,
                               (symbolS *) NULL,
                               (bfd_vma) 0, (symint_t) -1,
                               ECOFF_MARK_STAB (0));
@@ -3380,8 +3344,7 @@ mark_stabs (ignore)
 #ifndef TC_MIPS
 /* For TC_MIPS use the version in tc-mips.c.  */
 void
-ecoff_directive_weakext (ignore)
-     int ignore;
+ecoff_directive_weakext (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   int c;
@@ -3399,7 +3362,7 @@ ecoff_directive_weakext (ignore)
     {
       if (S_IS_DEFINED (symbolP))
        {
-         as_bad (_("Ignoring attempt to redefine symbol `%s'."),
+         as_bad (_("symbol `%s' is already defined"),
                  S_GET_NAME (symbolP));
          ignore_rest_of_line ();
          return;
@@ -3459,13 +3422,12 @@ ecoff_directive_weakext (ignore)
        value           a numeric value or an address.  */
 
 void
-ecoff_stab (sec, what, string, type, other, desc)
-     segT sec;
-     int what;
-     const char *string;
-     int type;
-     int other;
-     int desc;
+ecoff_stab (segT sec ATTRIBUTE_UNUSED,
+           int what,
+           const char *string,
+           int type,
+           int other,
+           int desc)
 {
   efdr_t *save_file_ptr = cur_file_ptr;
   symbolS *sym;
@@ -3525,7 +3487,7 @@ ecoff_stab (sec, what, string, type, other, desc)
       dummy_symr.index = desc;
       if (dummy_symr.index != desc)
        {
-         as_warn (_("Line number (%d) for .stab%c directive cannot fit in index field (20 bits)"),
+         as_warn (_("line number (%d) for .stab%c directive cannot fit in index field (20 bits)"),
                   desc, what);
          return;
        }
@@ -3549,7 +3511,7 @@ ecoff_stab (sec, what, string, type, other, desc)
        listing_source_file (string);
 #endif
 
-      if (isdigit ((unsigned char) *input_line_pointer)
+      if (ISDIGIT (*input_line_pointer)
          || *input_line_pointer == '-'
          || *input_line_pointer == '+')
        {
@@ -3561,7 +3523,7 @@ ecoff_stab (sec, what, string, type, other, desc)
        }
       else if (! is_name_beginner ((unsigned char) *input_line_pointer))
        {
-         as_warn (_("Illegal .stab%c directive, bad character"), what);
+         as_warn (_("illegal .stab%c directive, bad character"), what);
          return;
        }
       else
@@ -3614,8 +3576,7 @@ ecoff_stab (sec, what, string, type, other, desc)
    .scommon section rather than bfd_com_section.  */
 
 void
-ecoff_frob_symbol (sym)
-     symbolS *sym;
+ecoff_frob_symbol (symbolS *sym)
 {
   if (S_IS_COMMON (sym)
       && S_GET_VALUE (sym) > 0
@@ -3644,7 +3605,7 @@ ecoff_frob_symbol (sym)
   if (S_IS_WEAK (sym))
     {
       if (S_IS_COMMON (sym))
-       as_bad (_("Symbol `%s' can not be both weak and common"),
+       as_bad (_("symbol `%s' can not be both weak and common"),
                S_GET_NAME (sym));
     }
 }
@@ -3652,11 +3613,10 @@ ecoff_frob_symbol (sym)
 /* Add bytes to the symbolic information buffer.  */
 
 static char *
-ecoff_add_bytes (buf, bufend, bufptr, need)
-     char **buf;
-     char **bufend;
-     char *bufptr;
-     unsigned long need;
+ecoff_add_bytes (char **buf,
+                char **bufend,
+                char *bufptr,
+                unsigned long need)
 {
   unsigned long at;
   unsigned long want;
@@ -3666,7 +3626,7 @@ ecoff_add_bytes (buf, bufend, bufptr, need)
   if (need < PAGE_SIZE)
     need = PAGE_SIZE;
   want = (*bufend - *buf) + need;
-  *buf = xrealloc (*buf, want);
+  *buf = (char *) xrealloc (*buf, want);
   *bufend = *buf + want;
   return *buf + at;
 }
@@ -3675,12 +3635,11 @@ ecoff_add_bytes (buf, bufend, bufptr, need)
    for the ECOFF target debugging information.  */
 
 static unsigned long
-ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
-     char **bufptrptr;
+ecoff_padding_adjust (const struct ecoff_debug_swap *backend,
+                     char **buf,
+                     char **bufend,
+                     unsigned long offset,
+                     char **bufptrptr)
 {
   bfd_size_type align;
 
@@ -3690,7 +3649,7 @@ ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
       unsigned long add;
 
       add = align - (offset & (align - 1));
-      if (*bufend - (*buf + offset) < add)
+      if ((unsigned long) (*bufend - (*buf + offset)) < add)
        (void) ecoff_add_bytes (buf, bufend, *buf + offset, add);
       memset (*buf + offset, 0, add);
       offset += add;
@@ -3704,12 +3663,11 @@ ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
 /* Build the line number information.  */
 
 static unsigned long
-ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
-     long *linecntptr;
+ecoff_build_lineno (const struct ecoff_debug_swap *backend,
+                   char **buf,
+                   char **bufend,
+                   unsigned long offset,
+                   long *linecntptr)
 {
   char *bufptr;
   register lineno_list_t *l;
@@ -3734,6 +3692,8 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
   iline = 0;
   totcount = 0;
 
+  /* FIXME?  Now that MIPS embedded-PIC is gone, it may be safe to
+     remove this code.  */
   /* For some reason the address of the first procedure is ignored
      when reading line numbers.  This doesn't matter if the address of
      the first procedure is 0, but when gcc is generating MIPS
@@ -3934,14 +3894,13 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
 /* Build and swap out the symbols.  */
 
 static unsigned long
-ecoff_build_symbols (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_symbols (const struct ecoff_debug_swap *backend,
+                    char **buf,
+                    char **bufend,
+                    unsigned long offset)
 {
   const bfd_size_type external_sym_size = backend->external_sym_size;
-  void (* const swap_sym_out) PARAMS ((bfd *, const SYMR *, PTR))
+  void (* const swap_sym_out) (bfd *, const SYMR *, void *)
     = backend->swap_sym_out;
   char *sym_out;
   long isym;
@@ -4180,7 +4139,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        sym_ptr->ecoff_sym.asym.iss =
                          begin_ptr->ecoff_sym.asym.iss;
 
-                     begin_type = begin_ptr->ecoff_sym.asym.st;
+                     begin_type = (st_t) begin_ptr->ecoff_sym.asym.st;
                      if (begin_type == st_File
                          || begin_type == st_Block)
                        {
@@ -4254,7 +4213,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 
                  if (local)
                    {
-                     if (*bufend - sym_out < external_sym_size)
+                     if ((bfd_size_type)(*bufend - sym_out) < external_sym_size)
                        sym_out = ecoff_add_bytes (buf, bufend,
                                                   sym_out,
                                                   external_sym_size);
@@ -4300,14 +4259,13 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 /* Swap out the procedure information.  */
 
 static unsigned long
-ecoff_build_procs (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_procs (const struct ecoff_debug_swap *backend,
+                  char **buf,
+                  char **bufend,
+                  unsigned long offset)
 {
   const bfd_size_type external_pdr_size = backend->external_pdr_size;
-  void (* const swap_pdr_out) PARAMS ((bfd *, const PDR *, PTR))
+  void (* const swap_pdr_out) (bfd *, const PDR *, void *)
     = backend->swap_pdr_out;
   char *pdr_out;
   long iproc;
@@ -4372,7 +4330,7 @@ ecoff_build_procs (backend, buf, bufend, offset)
                      first = 0;
                    }
                  proc_ptr->pdr.adr = adr - fil_ptr->fdr.adr;
-                 if (*bufend - pdr_out < external_pdr_size)
+                 if ((bfd_size_type)(*bufend - pdr_out) < external_pdr_size)
                    pdr_out = ecoff_add_bytes (buf, bufend,
                                               pdr_out,
                                               external_pdr_size);
@@ -4391,11 +4349,10 @@ ecoff_build_procs (backend, buf, bufend, offset)
 /* Swap out the aux information.  */
 
 static unsigned long
-ecoff_build_aux (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_aux (const struct ecoff_debug_swap *backend,
+                char **buf,
+                char **bufend,
+                unsigned long offset)
 {
   int bigendian;
   union aux_ext *aux_out;
@@ -4445,7 +4402,8 @@ ecoff_build_aux (backend, buf, bufend, offset)
              aux_end = aux_ptr + aux_cnt;
              for (; aux_ptr < aux_end; aux_ptr++)
                {
-                 if (*bufend - (char *) aux_out < sizeof (union aux_ext))
+                 if ((unsigned long) (*bufend - (char *) aux_out)
+                     < sizeof (union aux_ext))
                    aux_out = ((union aux_ext *)
                               ecoff_add_bytes (buf, bufend,
                                                (char *) aux_out,
@@ -4505,11 +4463,10 @@ ecoff_build_aux (backend, buf, bufend, offset)
    bytes copied, rather than the new offset.  */
 
 static unsigned long
-ecoff_build_strings (buf, bufend, offset, vp)
-     char **buf;
-     char **bufend;
-     unsigned long offset;
-     varray_t *vp;
+ecoff_build_strings (char **buf,
+                    char **bufend,
+                    unsigned long offset,
+                    varray_t *vp)
 {
   unsigned long istr;
   char *str_out;
@@ -4530,7 +4487,7 @@ ecoff_build_strings (buf, bufend, offset, vp)
       else
        str_cnt = vp->objects_per_page;
 
-      if (*bufend - str_out < str_cnt)
+      if ((unsigned long)(*bufend - str_out) < str_cnt)
        str_out = ecoff_add_bytes (buf, bufend, str_out, str_cnt);
 
       memcpy (str_out, str_link->datum->byte, str_cnt);
@@ -4544,11 +4501,10 @@ ecoff_build_strings (buf, bufend, offset, vp)
 /* Dump out the local strings.  */
 
 static unsigned long
-ecoff_build_ss (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_ss (const struct ecoff_debug_swap *backend,
+               char **buf,
+               char **bufend,
+               unsigned long offset)
 {
   long iss;
   vlinks_t *file_link;
@@ -4588,14 +4544,13 @@ ecoff_build_ss (backend, buf, bufend, offset)
 /* Swap out the file descriptors.  */
 
 static unsigned long
-ecoff_build_fdr (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_fdr (const struct ecoff_debug_swap *backend,
+                char **buf,
+                char **bufend,
+                unsigned long offset)
 {
   const bfd_size_type external_fdr_size = backend->external_fdr_size;
-  void (* const swap_fdr_out) PARAMS ((bfd *, const FDR *, PTR))
+  void (* const swap_fdr_out) (bfd *, const FDR *, void *)
     = backend->swap_fdr_out;
   long ifile;
   char *fdr_out;
@@ -4621,7 +4576,7 @@ ecoff_build_fdr (backend, buf, bufend, offset)
       fil_end = fil_ptr + fil_cnt;
       for (; fil_ptr < fil_end; fil_ptr++)
        {
-         if (*bufend - fdr_out < external_fdr_size)
+         if ((bfd_size_type)(*bufend - fdr_out) < external_fdr_size)
            fdr_out = ecoff_add_bytes (buf, bufend, fdr_out,
                                       external_fdr_size);
          (*swap_fdr_out) (stdoutput, &fil_ptr->fdr, fdr_out);
@@ -4638,7 +4593,7 @@ ecoff_build_fdr (backend, buf, bufend, offset)
    calls a backend function to deal with it.  */
 
 static void
-ecoff_setup_ext ()
+ecoff_setup_ext (void)
 {
   register symbolS *sym;
 
@@ -4668,10 +4623,9 @@ ecoff_setup_ext ()
 /* Build the ECOFF debugging information.  */
 
 unsigned long
-ecoff_build_debug (hdr, bufp, backend)
-     HDRR *hdr;
-     char **bufp;
-     const struct ecoff_debug_swap *backend;
+ecoff_build_debug (HDRR *hdr,
+                  char **bufp,
+                  const struct ecoff_debug_swap *backend)
 {
   const bfd_size_type external_pdr_size = backend->external_pdr_size;
   tag_t *ptag;
@@ -4738,7 +4692,7 @@ ecoff_build_debug (hdr, bufp, backend)
          cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev;
          if (! end_warning && ! cur_file_ptr->fake)
            {
-             as_warn (_("Missing .end or .bend at end of file"));
+             as_warn (_("missing .end or .bend at end of file"));
              end_warning = 1;
            }
        }
@@ -4753,7 +4707,7 @@ ecoff_build_debug (hdr, bufp, backend)
 
   /* Build the symbolic information.  */
   offset = 0;
-  buf = xmalloc (PAGE_SIZE);
+  buf = (char *) xmalloc (PAGE_SIZE);
   bufend = buf + PAGE_SIZE;
 
   /* Build the line number information.  */
@@ -4771,7 +4725,7 @@ ecoff_build_debug (hdr, bufp, backend)
      space at this point.  */
   hdr->ipdMax = proc_cnt;
   hdr->cbPdOffset = offset;
-  if (bufend - (buf + offset) < proc_cnt * external_pdr_size)
+  if ((bfd_size_type)(bufend - (buf + offset)) < proc_cnt * external_pdr_size)
     (void) ecoff_add_bytes (&buf, &bufend, buf + offset,
                            proc_cnt * external_pdr_size);
   offset += proc_cnt * external_pdr_size;
@@ -4835,8 +4789,7 @@ ecoff_build_debug (hdr, bufp, backend)
 #ifndef MALLOC_CHECK
 
 static page_type *
-allocate_cluster (npages)
-     unsigned long npages;
+allocate_cluster (unsigned long npages)
 {
   register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE);
 
@@ -4858,7 +4811,7 @@ static unsigned long pages_left = 0;
 /* Allocate one page (which is initialized to 0).  */
 
 static page_type *
-allocate_page ()
+allocate_page (void)
 {
 #ifndef MALLOC_CHECK
 
@@ -4885,7 +4838,7 @@ allocate_page ()
 /* Allocate scoping information.  */
 
 static scope_t *
-allocate_scope ()
+allocate_scope (void)
 {
   register scope_t *ptr;
   static scope_t initial_scope;
@@ -4925,8 +4878,7 @@ allocate_scope ()
 /* Free scoping information.  */
 
 static void
-free_scope (ptr)
-     scope_t *ptr;
+free_scope (scope_t *ptr)
 {
   alloc_counts[(int) alloc_type_scope].total_free++;
 
@@ -4934,14 +4886,14 @@ free_scope (ptr)
   ptr->free = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
   alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr;
 #else
-  free ((PTR) ptr);
+  free ((void *) ptr);
 #endif
 }
 \f
 /* Allocate links for pages in a virtual array.  */
 
 static vlinks_t *
-allocate_vlinks ()
+allocate_vlinks (void)
 {
   register vlinks_t *ptr;
   static vlinks_t initial_vlinks;
@@ -4975,7 +4927,7 @@ allocate_vlinks ()
 /* Allocate string hash buckets.  */
 
 static shash_t *
-allocate_shash ()
+allocate_shash (void)
 {
   register shash_t *ptr;
   static shash_t initial_shash;
@@ -5009,7 +4961,7 @@ allocate_shash ()
 /* Allocate type hash buckets.  */
 
 static thash_t *
-allocate_thash ()
+allocate_thash (void)
 {
   register thash_t *ptr;
   static thash_t initial_thash;
@@ -5043,7 +4995,7 @@ allocate_thash ()
 /* Allocate structure, union, or enum tag information.  */
 
 static tag_t *
-allocate_tag ()
+allocate_tag (void)
 {
   register tag_t *ptr;
   static tag_t initial_tag;
@@ -5083,8 +5035,7 @@ allocate_tag ()
 /* Free scoping information.  */
 
 static void
-free_tag (ptr)
-     tag_t *ptr;
+free_tag (tag_t *ptr)
 {
   alloc_counts[(int) alloc_type_tag].total_free++;
 
@@ -5099,7 +5050,7 @@ free_tag (ptr)
 /* Allocate forward reference to a yet unknown tag.  */
 
 static forward_t *
-allocate_forward ()
+allocate_forward (void)
 {
   register forward_t *ptr;
   static forward_t initial_forward;
@@ -5133,7 +5084,7 @@ allocate_forward ()
 /* Allocate head of type hash list.  */
 
 static thead_t *
-allocate_thead ()
+allocate_thead (void)
 {
   register thead_t *ptr;
   static thead_t initial_thead;
@@ -5173,8 +5124,7 @@ allocate_thead ()
 /* Free scoping information.  */
 
 static void
-free_thead (ptr)
-     thead_t *ptr;
+free_thead (thead_t *ptr)
 {
   alloc_counts[(int) alloc_type_thead].total_free++;
 
@@ -5187,7 +5137,7 @@ free_thead (ptr)
 }
 \f
 static lineno_list_t *
-allocate_lineno_list ()
+allocate_lineno_list (void)
 {
   register lineno_list_t *ptr;
   static lineno_list_t initial_lineno_list;
@@ -5219,8 +5169,7 @@ allocate_lineno_list ()
 }
 
 void
-ecoff_set_gp_prolog_size (sz)
-     int sz;
+ecoff_set_gp_prolog_size (int sz)
 {
   if (cur_proc_ptr == 0)
     return;
@@ -5236,13 +5185,13 @@ ecoff_set_gp_prolog_size (sz)
 }
 
 int
-ecoff_no_current_file ()
+ecoff_no_current_file (void)
 {
   return cur_file_ptr == (efdr_t *) NULL;
 }
 
 void
-ecoff_generate_asm_lineno ()
+ecoff_generate_asm_lineno (void)
 {
   unsigned int lineno;
   char *filename;
@@ -5289,7 +5238,7 @@ ecoff_generate_asm_lineno ()
 #else
 
 void
-ecoff_generate_asm_lineno ()
+ecoff_generate_asm_lineno (void)
 {
 }