From a1e5be4482947e6fd0531dce943380fe3f2c6420 Mon Sep 17 00:00:00 2001 From: David Malone Date: Tue, 29 Jun 2004 21:13:15 +0000 Subject: [PATCH] The type of some aout header types changed to uint_32, so now we need to cast to long before printing. While I'm here, raise WARNS to 6. --- usr.bin/ldd/Makefile | 1 + usr.bin/ldd/sods.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile index f0ec53381544..bb04f4550e32 100644 --- a/usr.bin/ldd/Makefile +++ b/usr.bin/ldd/Makefile @@ -5,5 +5,6 @@ SRCS= ldd.c .if ${MACHINE_ARCH} == "i386" SRCS+= sods.c .endif +WARNS?= 6 .include diff --git a/usr.bin/ldd/sods.c b/usr.bin/ldd/sods.c index cdc5e783a09d..e6de90fcae38 100644 --- a/usr.bin/ldd/sods.c +++ b/usr.bin/ldd/sods.c @@ -192,9 +192,9 @@ dump_file(const char *fname) ex = (const struct exec *) file_base; - printf("%s: a_midmag = 0x%lx\n", fname, ex->a_midmag); + printf("%s: a_midmag = 0x%lx\n", fname, (long)ex->a_midmag); printf(" magic = 0x%lx = 0%lo, netmagic = 0x%lx = 0%lo\n", - N_GETMAGIC(*ex), N_GETMAGIC(*ex), + (long)N_GETMAGIC(*ex), (long)N_GETMAGIC(*ex), (long)N_GETMAGIC_NET(*ex), (long)N_GETMAGIC_NET(*ex)); if (N_BADMAG(*ex)) { @@ -204,13 +204,13 @@ dump_file(const char *fname) return; } - printf(" a_text = 0x%lx\n", ex->a_text); - printf(" a_data = 0x%lx\n", ex->a_data); - printf(" a_bss = 0x%lx\n", ex->a_bss); - printf(" a_syms = 0x%lx\n", ex->a_syms); - printf(" a_entry = 0x%lx\n", ex->a_entry); - printf(" a_trsize = 0x%lx\n", ex->a_trsize); - printf(" a_drsize = 0x%lx\n", ex->a_drsize); + printf(" a_text = 0x%lx\n", (long)ex->a_text); + printf(" a_data = 0x%lx\n", (long)ex->a_data); + printf(" a_bss = 0x%lx\n", (long)ex->a_bss); + printf(" a_syms = 0x%lx\n", (long)ex->a_syms); + printf(" a_entry = 0x%lx\n", (long)ex->a_entry); + printf(" a_trsize = 0x%lx\n", (long)ex->a_trsize); + printf(" a_drsize = 0x%lx\n", (long)ex->a_drsize); text_base = file_base + N_TXTOFF(*ex); data_base = file_base + N_DATOFF(*ex); @@ -228,11 +228,11 @@ dump_file(const char *fname) assert(sym_used != NULL); } - printf(" Entry = 0x%lx\n", ex->a_entry); + printf(" Entry = 0x%lx\n", (long)ex->a_entry); printf(" Text offset = %x, address = %lx\n", N_TXTOFF(*ex), - N_TXTADDR(*ex)); - printf(" Data offset = %lx, address = %lx\n", N_DATOFF(*ex), - N_DATADDR(*ex)); + (long)N_TXTADDR(*ex)); + printf(" Data offset = %lx, address = %lx\n", (long)N_DATOFF(*ex), + (long)N_DATADDR(*ex)); /* * In an executable program file, everything is relocated relative to