From 54e57c8145e0c37cc49e92adf0021c7da62587d6 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Thu, 10 Jun 2010 14:19:51 +0000 Subject: [PATCH] Make the char *n_name member of struct nlist 'const'. This avoids errors or __DECONST() from places with higher WARNS levels. Adjust a local cache variable in ipcs to const as well to compile in the new world order. Suggested by: jhb Reviewed by: jhb, kib, brueffer (man) --- share/man/man5/a.out.5 | 14 +++++++------- share/man/man5/stab.5 | 4 ++-- sys/sys/nlist_aout.h | 4 ++-- usr.bin/ipcs/ipc.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man5/a.out.5 b/share/man/man5/a.out.5 index 137b2e4a4ead..d6318efdda16 100644 --- a/share/man/man5/a.out.5 +++ b/share/man/man5/a.out.5 @@ -35,7 +35,7 @@ .\" @(#)a.out.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd June 10, 2010 .Dt A.OUT 5 .Os .Sh NAME @@ -307,13 +307,13 @@ structures: .Bd -literal -offset indent struct nlist { union { - char *n_name; - long n_strx; + const char *n_name; + long n_strx; } n_un; - unsigned char n_type; - char n_other; - short n_desc; - unsigned long n_value; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; }; .Ed .Pp diff --git a/share/man/man5/stab.5 b/share/man/man5/stab.5 index bbbd29208394..bc4e680a87b9 100644 --- a/share/man/man5/stab.5 +++ b/share/man/man5/stab.5 @@ -32,7 +32,7 @@ .\" @(#)stab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd June 10, 2010 .Dt STAB 5 .Os .Sh NAME @@ -79,7 +79,7 @@ consists of the following structure: struct nlist { union { - char *n_name; /* for use when in-core */ + const char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag */ diff --git a/sys/sys/nlist_aout.h b/sys/sys/nlist_aout.h index a4e11c3975a9..fc7a3c781c57 100644 --- a/sys/sys/nlist_aout.h +++ b/sys/sys/nlist_aout.h @@ -51,11 +51,11 @@ struct nlist { #ifdef _AOUT_INCLUDE_ union { - char *n_name; /* symbol name (in memory) */ + const char *n_name; /* symbol name (in memory) */ long n_strx; /* file string table offset (on disk) */ } n_un; #else - char *n_name; /* symbol name (in memory) */ + const char *n_name; /* symbol name (in memory) */ int : 8 * (sizeof(long) > sizeof(char *) ? sizeof(long) - sizeof(char *) : sizeof(char *) - sizeof(long)); #endif diff --git a/usr.bin/ipcs/ipc.c b/usr.bin/ipcs/ipc.c index dfb4bae0d31c..f904e018481c 100644 --- a/usr.bin/ipcs/ipc.c +++ b/usr.bin/ipcs/ipc.c @@ -128,7 +128,7 @@ sysctlgatherstruct(void *addr, size_t size, struct scgs_vector *vecarr) void kget(int idx, void *addr, size_t size) { - char *symn; /* symbol name */ + const char *symn; /* symbol name */ size_t tsiz; int rv; unsigned long kaddr;