summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/ld
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-07-12 19:08:36 +0000
committerjkh <jkh@FreeBSD.org>1996-07-12 19:08:36 +0000
commit730964efd28b80be48ed35a215a362dde2b6b7a7 (patch)
treeb07c215aa55db3fb81db462f4bc70f61cd56c57f /gnu/usr.bin/ld
parentc4d4a99d31762beef936f34571330923e9300da9 (diff)
downloadFreeBSD-src-730964efd28b80be48ed35a215a362dde2b6b7a7.zip
FreeBSD-src-730964efd28b80be48ed35a215a362dde2b6b7a7.tar.gz
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
Diffstat (limited to 'gnu/usr.bin/ld')
-rw-r--r--gnu/usr.bin/ld/ld.c13
-rw-r--r--gnu/usr.bin/ld/ldconfig/ldconfig.c8
-rw-r--r--gnu/usr.bin/ld/lib.c4
-rw-r--r--gnu/usr.bin/ld/rrs.c6
-rw-r--r--gnu/usr.bin/ld/rtld/malloc.c5
-rw-r--r--gnu/usr.bin/ld/warnings.c8
6 files changed, 24 insertions, 20 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c
index a1205fd..3a9dfeb 100644
--- a/gnu/usr.bin/ld/ld.c
+++ b/gnu/usr.bin/ld/ld.c
@@ -32,7 +32,7 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91";
Set, indirect, and warning symbol features added by Randy Smith. */
/*
- * $Id: ld.c,v 1.33 1996/05/28 16:17:48 phk Exp $
+ * $Id: ld.c,v 1.34 1996/06/08 04:52:57 wpaul Exp $
*/
/* Define how to initialize system-dependent header fields. */
@@ -875,10 +875,10 @@ check_each_file(function, arg)
for (; subentry; subentry = subentry->chain) {
if (subentry->flags & E_SCRAPPED)
continue;
- if (return_val = (*function)(subentry, arg))
+ if ( (return_val = (*function)(subentry, arg)) )
return return_val;
}
- } else if (return_val = (*function)(entry, arg))
+ } else if ( (return_val = (*function)(entry, arg)) )
return return_val;
}
return 0;
@@ -2391,7 +2391,7 @@ digest_pass2()
/* Flag second-hand definitions */
undefined_global_sym_count++;
if (sp->flags & GS_TRACE)
- printf("symbol %s assigned to location %#x\n",
+ printf("symbol %s assigned to location %#lx\n",
sp->name, sp->value);
}
@@ -2456,7 +2456,7 @@ digest_pass2()
}
bss_size += size;
if (write_map)
- printf("Allocating %s %s: %x at %x\n",
+ printf("Allocating %s %s: %x at %lx\n",
sp->defined==(N_BSS|N_EXT)?"common":"data",
sp->name, size, sp->value);
@@ -3607,7 +3607,8 @@ write_file_syms(entry, syms_written_addr)
continue;
if (discard_locals == DISCARD_ALL ||
- discard_locals == DISCARD_L && lsp->flags & LS_L_SYMBOL) {
+ (discard_locals == DISCARD_L &&
+ (lsp->flags & LS_L_SYMBOL))) {
/*
* The user wants to discard this symbol, but it
* is referenced by a relocation. We can still
diff --git a/gnu/usr.bin/ld/ldconfig/ldconfig.c b/gnu/usr.bin/ld/ldconfig/ldconfig.c
index 13cd297..6eb49e0 100644
--- a/gnu/usr.bin/ld/ldconfig/ldconfig.c
+++ b/gnu/usr.bin/ld/ldconfig/ldconfig.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ldconfig.c,v 1.13 1996/01/09 00:04:35 pk Exp $
+ * $Id: ldconfig.c,v 1.12 1996/02/26 02:22:33 pst Exp $
*/
#include <sys/param.h>
@@ -39,6 +39,8 @@
#include <sys/resource.h>
#include <dirent.h>
#include <errno.h>
+#include <err.h>
+#include <ctype.h>
#include <fcntl.h>
#include <ar.h>
#include <ranlib.h>
@@ -114,7 +116,7 @@ char *argv[];
return rval;
if (justread) {
listhints();
- return;
+ return 0;
}
}
@@ -288,7 +290,7 @@ buildhints()
hdr.hh_ehints = hdr.hh_strtab + hdr.hh_strtab_sz;
if (verbose)
- printf("Totals: entries %d, buckets %d, string size %d\n",
+ printf("Totals: entries %d, buckets %ld, string size %d\n",
nhints, hdr.hh_nbucket, strtab_sz);
/* Allocate buckets and string table */
diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c
index 5e119ba..550dedf 100644
--- a/gnu/usr.bin/ld/lib.c
+++ b/gnu/usr.bin/ld/lib.c
@@ -1,5 +1,5 @@
/*
- * $Id: lib.c,v 1.15 1995/05/30 05:01:46 rgrimes Exp $ - library routines
+ * $Id: lib.c,v 1.16 1995/09/28 19:43:22 bde Exp $ - library routines
*/
#include <sys/param.h>
@@ -841,7 +841,7 @@ struct file_entry *p;
dot_a:
p->flags &= ~E_SEARCH_DYNAMIC;
- if (cp = strrchr(p->filename, '/')) {
+ if ( (cp = strrchr(p->filename, '/')) ) {
*cp++ = '\0';
fname = concat(concat(p->filename, "/lib", cp), ".a", "");
*(--cp) = '/';
diff --git a/gnu/usr.bin/ld/rrs.c b/gnu/usr.bin/ld/rrs.c
index 602bccf..d218b9c 100644
--- a/gnu/usr.bin/ld/rrs.c
+++ b/gnu/usr.bin/ld/rrs.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rrs.c,v 1.14 1995/03/04 17:46:09 nate Exp $
+ * $Id: rrs.c,v 1.15 1996/05/27 18:06:02 jdp Exp $
*/
#include <sys/param.h>
@@ -74,7 +74,6 @@ static int rrs_symbol_size;
static int current_jmpslot_offset;
static int current_got_offset;
static int got_origin;
-static int current_reloc_offset;
static int current_hash_index;
int number_of_shobjs;
@@ -662,9 +661,10 @@ void
consider_rrs_section_lengths()
{
int n;
- struct shobj *shp, **shpp;
+ struct shobj *shp;
#ifdef notyet
+ struct shobj **shpp;
/* We run into trouble with this as long as shared object symbols
are not checked for definitions */
/*
diff --git a/gnu/usr.bin/ld/rtld/malloc.c b/gnu/usr.bin/ld/rtld/malloc.c
index 60e6ec3..5d1d0a4 100644
--- a/gnu/usr.bin/ld/rtld/malloc.c
+++ b/gnu/usr.bin/ld/rtld/malloc.c
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: malloc.c,v 1.3 1995/03/04 17:46:24 nate Exp $";
+static char *rcsid = "$Id: malloc.c,v 1.4 1995/05/30 05:01:48 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -66,6 +66,7 @@ static char *rcsid = "$Id: malloc.c,v 1.3 1995/03/04 17:46:24 nate Exp $";
#define NULL 0
+extern void xprintf __P((char *, ...));
static void morecore();
static int findbucket();
@@ -390,7 +391,7 @@ realloc(cp, nbytes)
* header starts at ``freep''. If srchlen is -1 search the whole list.
* Return bucket number, or -1 if not found.
*/
-static
+static int
findbucket(freep, srchlen)
union overhead *freep;
int srchlen;
diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c
index 3c65a22..b4f0b3e 100644
--- a/gnu/usr.bin/ld/warnings.c
+++ b/gnu/usr.bin/ld/warnings.c
@@ -1,5 +1,5 @@
/*
- * $Id: warnings.c,v 1.9 1994/12/23 22:30:57 nate Exp $
+ * $Id: warnings.c,v 1.10 1995/03/04 17:46:10 nate Exp $
*/
#include <sys/param.h>
@@ -113,7 +113,7 @@ print_symbols(outfile)
else if (sp->defined == (N_UNDF|N_EXT))
fprintf(outfile, "common: size %#x", sp->common_size);
else
- fprintf(outfile, "type %d, value %#x, size %#x",
+ fprintf(outfile, "type %d, value %#lx, size %#x",
sp->defined, sp->value, sp->size);
if (sp->alias)
fprintf(outfile, ", aliased to %s", sp->alias->name);
@@ -133,7 +133,7 @@ describe_file_sections(entry, outfile)
if (entry->flags & (E_JUST_SYMS | E_DYNAMIC))
fprintf(outfile, " symbols only\n");
else
- fprintf(outfile, " text %x(%x), data %x(%x), bss %x(%x) hex\n",
+ fprintf(outfile, " text %x(%lx), data %x(%lx), bss %x(%lx) hex\n",
entry->text_start_address, entry->header.a_text,
entry->data_start_address, entry->header.a_data,
entry->bss_start_address, entry->header.a_bss);
@@ -161,7 +161,7 @@ list_file_locals (entry, outfile)
* update it if necessary by this file's start address.
*/
if (!(p->n_type & (N_STAB | N_EXT)))
- fprintf(outfile, " %s: 0x%x\n",
+ fprintf(outfile, " %s: 0x%lx\n",
entry->strings + p->n_un.n_strx, p->n_value);
}
OpenPOWER on IntegriCloud