Module Name: src Committed By: christos Date: Sat Feb 7 20:30:04 UTC 2015
Modified Files: src/external/cddl/osnet: Makefile.inc src/external/cddl/osnet/dist/cmd/dtrace: dtrace.c src/external/cddl/osnet/dist/common/ctf: ctf_create.c ctf_hash.c ctf_labels.c ctf_lookup.c ctf_open.c ctf_types.c src/external/cddl/osnet/dist/lib/libctf/common: ctf_lib.c src/external/cddl/osnet/dist/lib/libdtrace/common: dt_aggregate.c dt_as.c dt_cc.c dt_cg.c dt_consume.c dt_dis.c dt_dof.c dt_ident.c dt_lex.l dt_link.c dt_list.h dt_module.c dt_open.c dt_options.c dt_parser.c dt_pid.c dt_pragma.c dt_printf.c dt_proc.c dt_program.c dt_subr.c dt_work.c src/external/cddl/osnet/dist/lib/libgen/common: gmatch.c src/external/cddl/osnet/dist/tools/ctf/cvt: ctf.c ctfmerge.c ctftools.h dwarf.c st_parse.c stabs.c util.c src/external/cddl/osnet/lib/libdtrace: Makefile src/external/cddl/osnet/sys/sys: sysmacros.h Log Message: check and fix printf formats, negative array indices, uninitialized variables, shadowed variables. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/Makefile.inc cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/dist/common/ctf/ctf_create.c \ src/external/cddl/osnet/dist/common/ctf/ctf_open.c cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/cddl/osnet/dist/common/ctf/ctf_hash.c \ src/external/cddl/osnet/dist/common/ctf/ctf_labels.c \ src/external/cddl/osnet/dist/common/ctf/ctf_lookup.c \ src/external/cddl/osnet/dist/common/ctf/ctf_types.c cvs rdiff -u -r1.4 -r1.5 \ src/external/cddl/osnet/dist/lib/libctf/common/ctf_lib.c cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_aggregate.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_parser.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_as.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_list.h cvs rdiff -u -r1.2 -r1.3 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cc.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cg.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dis.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dof.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_ident.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_lex.l \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pragma.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_work.c cvs rdiff -u -r1.5 -r1.6 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_options.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c cvs rdiff -u -r1.6 -r1.7 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c cvs rdiff -u -r1.7 -r1.8 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c cvs rdiff -u -r1.4 -r1.5 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c cvs rdiff -u -r1.8 -r1.9 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/lib/libgen/common/gmatch.c cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c cvs rdiff -u -r1.9 -r1.10 \ src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/tools/ctf/cvt/ctftools.h cvs rdiff -u -r1.11 -r1.12 src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c cvs rdiff -u -r1.4 -r1.5 \ src/external/cddl/osnet/dist/tools/ctf/cvt/st_parse.c \ src/external/cddl/osnet/dist/tools/ctf/cvt/stabs.c \ src/external/cddl/osnet/dist/tools/ctf/cvt/util.c cvs rdiff -u -r1.9 -r1.10 src/external/cddl/osnet/lib/libdtrace/Makefile cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/sys/sys/sysmacros.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/cddl/osnet/Makefile.inc diff -u src/external/cddl/osnet/Makefile.inc:1.1 src/external/cddl/osnet/Makefile.inc:1.2 --- src/external/cddl/osnet/Makefile.inc:1.1 Sat Feb 20 20:46:32 2010 +++ src/external/cddl/osnet/Makefile.inc Sat Feb 7 15:30:03 2015 @@ -1,6 +1,8 @@ # $FreeBSD: src/cddl/Makefile.inc,v 1.6.2.1 2009/08/03 08:13:06 kensmith Exp $ +WARNS?=5 OSNETDIR= ${NETBSDSRCDIR}/external/cddl/osnet OPENSOLARIS_USR_DISTDIR=${OSNETDIR}/dist OPENSOLARIS_SYS_DISTDIR=${OSNETDIR}/dist +CPPFLAGS+=-Wno-unknown-pragmas -Wno-sign-compare Index: src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c diff -u src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.4 src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.5 --- src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.4 Thu Mar 27 22:58:36 2014 +++ src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c Sat Feb 7 15:30:03 2015 @@ -850,16 +850,16 @@ setopthandler(const dtrace_setoptdata_t #define BUFDUMPSTR(ptr, field) \ (void) printf("%s: %20s => ", g_pname, #field); \ if ((ptr)->field != NULL) { \ - const char *c = (ptr)->field; \ + const char *xc = (ptr)->field; \ (void) printf("\""); \ do { \ - if (*c == '\n') { \ + if (*xc == '\n') { \ (void) printf("\\n"); \ continue; \ } \ \ - (void) printf("%c", *c); \ - } while (*c++ != '\0'); \ + (void) printf("%c", *xc); \ + } while (*xc++ != '\0'); \ (void) printf("\"\n"); \ } else { \ (void) printf("<NULL>\n"); \ @@ -1084,18 +1084,18 @@ go(void) int i; struct { - char *name; - char *optname; + const char *name; + const char *optname; dtrace_optval_t val; } bufs[] = { - { "buffer size", "bufsize" }, - { "aggregation size", "aggsize" }, - { "speculation size", "specsize" }, - { "dynamic variable size", "dynvarsize" }, + { "buffer size", "bufsize", 0 }, + { "aggregation size", "aggsize", 0 }, + { "speculation size", "specsize", 0 }, + { "dynamic variable size", "dynvarsize", 0 }, { NULL } }, rates[] = { - { "cleaning rate", "cleanrate" }, - { "status rate", "statusrate" }, + { "cleaning rate", "cleanrate", 0 }, + { "status rate", "statusrate", 0 }, { NULL } }; @@ -1141,7 +1141,7 @@ go(void) for (i = 0; rates[i].name != NULL; i++) { dtrace_optval_t nval; - char *dir; + const char *dir; if (rates[i].val == DTRACEOPT_UNSET) continue; @@ -1761,7 +1761,7 @@ main(int argc, char *argv[]) } if (g_ofile == NULL) { - char *p; + char *pv; if (g_cmdc > 1) { (void) fprintf(stderr, "%s: -h requires an " @@ -1771,8 +1771,8 @@ main(int argc, char *argv[]) return (E_USAGE); } - if ((p = strrchr(g_cmdv[0].dc_arg, '.')) == NULL || - strcmp(p, ".d") != 0) { + if ((pv = strrchr(g_cmdv[0].dc_arg, '.')) == NULL || + strcmp(pv, ".d") != 0) { (void) fprintf(stderr, "%s: -h requires an " "output file if no scripts are " "specified\n", g_pname); @@ -1780,9 +1780,9 @@ main(int argc, char *argv[]) return (E_USAGE); } - p[0] = '\0'; /* strip .d suffix */ - g_ofile = p = g_cmdv[0].dc_ofile; - (void) snprintf(p, sizeof (g_cmdv[0].dc_ofile), + pv[0] = '\0'; /* strip .d suffix */ + g_ofile = pv = g_cmdv[0].dc_ofile; + (void) snprintf(pv, sizeof (g_cmdv[0].dc_ofile), "%s.h", basename(g_cmdv[0].dc_arg)); } Index: src/external/cddl/osnet/dist/common/ctf/ctf_create.c diff -u src/external/cddl/osnet/dist/common/ctf/ctf_create.c:1.2 src/external/cddl/osnet/dist/common/ctf/ctf_create.c:1.3 --- src/external/cddl/osnet/dist/common/ctf/ctf_create.c:1.2 Sat Feb 20 20:46:34 2010 +++ src/external/cddl/osnet/dist/common/ctf/ctf_create.c Sat Feb 7 15:30:03 2015 @@ -50,7 +50,11 @@ static const char _CTF_STRTAB_TEMPLATE[] ctf_file_t * ctf_create(int *errp) { - static const ctf_header_t hdr = { { CTF_MAGIC, CTF_VERSION, 0 } }; + static const ctf_header_t hdr = { .cth_preamble = { + .ctp_magic = CTF_MAGIC, + .ctp_version = CTF_VERSION, + .ctp_flags = 0 + } }; const ulong_t hashlen = 128; ctf_dtdef_t **hash = ctf_alloc(hashlen * sizeof (ctf_dtdef_t *)); @@ -60,10 +64,10 @@ ctf_create(int *errp) if (hash == NULL) return (ctf_set_open_errno(errp, EAGAIN)); - cts.cts_name = (char *)_CTF_SECTION; + cts.cts_name = __UNCONST(_CTF_SECTION); cts.cts_type = SHT_PROGBITS; cts.cts_flags = 0; - cts.cts_data = (ctf_header_t *)&hdr; + cts.cts_data = __UNCONST(&hdr); cts.cts_size = sizeof (hdr); cts.cts_entsize = 1; cts.cts_offset = 0; @@ -364,7 +368,7 @@ ctf_update(ctf_file_t *fp) * is successful, we then switch nfp and fp and free the old container. */ ctf_data_protect(buf, size); - cts.cts_name = (char *)_CTF_SECTION; + cts.cts_name = __UNCONST(_CTF_SECTION); cts.cts_type = SHT_PROGBITS; cts.cts_flags = 0; cts.cts_data = buf; @@ -500,7 +504,7 @@ ctf_dtd_lookup(ctf_file_t *fp, ctf_id_t int ctf_discard(ctf_file_t *fp) { - ctf_dtdef_t *dtd, *ntd; + ctf_dtdef_t *dtd, *ntd = NULL; if (!(fp->ctf_flags & LCTF_RDWR)) return (ctf_set_errno(fp, ECTF_RDONLY)); Index: src/external/cddl/osnet/dist/common/ctf/ctf_open.c diff -u src/external/cddl/osnet/dist/common/ctf/ctf_open.c:1.2 src/external/cddl/osnet/dist/common/ctf/ctf_open.c:1.3 --- src/external/cddl/osnet/dist/common/ctf/ctf_open.c:1.2 Sat Feb 20 20:46:34 2010 +++ src/external/cddl/osnet/dist/common/ctf/ctf_open.c Sat Feb 7 15:30:03 2015 @@ -80,7 +80,7 @@ get_vlen_v2(ushort_t info) } static const ctf_fileops_t ctf_fileops[] = { - { NULL, NULL }, + { NULL, NULL, NULL }, { get_kind_v1, get_root_v1, get_vlen_v1 }, { get_kind_v2, get_root_v2, get_vlen_v2 }, }; @@ -199,9 +199,9 @@ static int init_types(ctf_file_t *fp, const ctf_header_t *cth) { /* LINTED - pointer alignment */ - const ctf_type_t *tbuf = (ctf_type_t *)(fp->ctf_buf + cth->cth_typeoff); + const ctf_type_t *tbuf = (const ctf_type_t *)(fp->ctf_buf + cth->cth_typeoff); /* LINTED - pointer alignment */ - const ctf_type_t *tend = (ctf_type_t *)(fp->ctf_buf + cth->cth_stroff); + const ctf_type_t *tend = (const ctf_type_t *)(fp->ctf_buf + cth->cth_stroff); ulong_t pop[CTF_K_MAX + 1] = { 0 }; const ctf_type_t *tp; @@ -694,11 +694,11 @@ ctf_bufopen(const ctf_sect_t *ctfsect, c fp->ctf_strtab.cts_name = ctf_strdup(fp->ctf_strtab.cts_name); if (fp->ctf_data.cts_name == NULL) - fp->ctf_data.cts_name = (char *)_CTF_NULLSTR; + fp->ctf_data.cts_name = __UNCONST(_CTF_NULLSTR); if (fp->ctf_symtab.cts_name == NULL) - fp->ctf_symtab.cts_name = (char *)_CTF_NULLSTR; + fp->ctf_symtab.cts_name = __UNCONST(_CTF_NULLSTR); if (fp->ctf_strtab.cts_name == NULL) - fp->ctf_strtab.cts_name = (char *)_CTF_NULLSTR; + fp->ctf_strtab.cts_name = __UNCONST(_CTF_NULLSTR); fp->ctf_str[CTF_STRTAB_0].cts_strs = (const char *)buf + hp.cth_stroff; fp->ctf_str[CTF_STRTAB_0].cts_len = hp.cth_strlen; @@ -845,7 +845,7 @@ ctf_close(ctf_file_t *fp) } if (fp->ctf_base != fp->ctf_data.cts_data && fp->ctf_base != NULL) - ctf_data_free((void *)fp->ctf_base, fp->ctf_size); + ctf_data_free(__UNCONST(fp->ctf_base), fp->ctf_size); if (fp->ctf_sxlate != NULL) ctf_free(fp->ctf_sxlate, sizeof (uint_t) * fp->ctf_nsyms); Index: src/external/cddl/osnet/dist/common/ctf/ctf_hash.c diff -u src/external/cddl/osnet/dist/common/ctf/ctf_hash.c:1.1.1.1 src/external/cddl/osnet/dist/common/ctf/ctf_hash.c:1.2 --- src/external/cddl/osnet/dist/common/ctf/ctf_hash.c:1.1.1.1 Fri Feb 19 23:33:52 2010 +++ src/external/cddl/osnet/dist/common/ctf/ctf_hash.c Sat Feb 7 15:30:03 2015 @@ -43,7 +43,7 @@ ctf_hash_create(ctf_hash_t *hp, ulong_t */ if (nelems == 0) { bzero(hp, sizeof (ctf_hash_t)); - hp->h_buckets = (ushort_t *)_CTF_EMPTY; + hp->h_buckets = __UNCONST(_CTF_EMPTY); hp->h_nbuckets = 1; return (0); } Index: src/external/cddl/osnet/dist/common/ctf/ctf_labels.c diff -u src/external/cddl/osnet/dist/common/ctf/ctf_labels.c:1.1.1.1 src/external/cddl/osnet/dist/common/ctf/ctf_labels.c:1.2 --- src/external/cddl/osnet/dist/common/ctf/ctf_labels.c:1.1.1.1 Fri Feb 19 23:33:52 2010 +++ src/external/cddl/osnet/dist/common/ctf/ctf_labels.c Sat Feb 7 15:30:03 2015 @@ -54,9 +54,9 @@ extract_label_info(ctf_file_t *fp, const const char * ctf_label_topmost(ctf_file_t *fp) { - const ctf_lblent_t *ctlp; + const ctf_lblent_t *ctlp = NULL; const char *s; - uint_t num_labels; + uint_t num_labels = 0; if (extract_label_info(fp, &ctlp, &num_labels) == CTF_ERR) return (NULL); /* errno is set */ @@ -79,8 +79,8 @@ ctf_label_topmost(ctf_file_t *fp) int ctf_label_iter(ctf_file_t *fp, ctf_label_f *func, void *arg) { - const ctf_lblent_t *ctlp; - uint_t i, num_labels; + const ctf_lblent_t *ctlp = NULL; + uint_t i, num_labels = 0; ctf_lblinfo_t linfo; const char *lname; int rc; Index: src/external/cddl/osnet/dist/common/ctf/ctf_lookup.c diff -u src/external/cddl/osnet/dist/common/ctf/ctf_lookup.c:1.1.1.1 src/external/cddl/osnet/dist/common/ctf/ctf_lookup.c:1.2 --- src/external/cddl/osnet/dist/common/ctf/ctf_lookup.c:1.1.1.1 Fri Feb 19 23:33:52 2010 +++ src/external/cddl/osnet/dist/common/ctf/ctf_lookup.c Sat Feb 7 15:30:03 2015 @@ -90,7 +90,7 @@ ctf_lookup_by_name(ctf_file_t *fp, const return (ctf_set_errno(fp, EINVAL)); for (p = name, end = name + strlen(name); *p != '\0'; p = q) { - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; /* skip leading ws */ if (p == end) @@ -132,13 +132,13 @@ ctf_lookup_by_name(ctf_file_t *fp, const for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) { if (lp->ctl_prefix[0] == '\0' || strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0) { - for (p += lp->ctl_len; isspace(*p); p++) + for (p += lp->ctl_len; isspace((unsigned char)*p); p++) continue; /* skip prefix and next ws */ if ((q = strchr(p, '*')) == NULL) q = end; /* compare until end */ - while (isspace(q[-1])) + while (isspace((unsigned char)q[-1])) q--; /* exclude trailing ws */ if ((hp = ctf_hash_lookup(lp->ctl_hash, fp, p, Index: src/external/cddl/osnet/dist/common/ctf/ctf_types.c diff -u src/external/cddl/osnet/dist/common/ctf/ctf_types.c:1.1.1.1 src/external/cddl/osnet/dist/common/ctf/ctf_types.c:1.2 --- src/external/cddl/osnet/dist/common/ctf/ctf_types.c:1.1.1.1 Fri Feb 19 23:33:53 2010 +++ src/external/cddl/osnet/dist/common/ctf/ctf_types.c Sat Feb 7 15:30:03 2015 @@ -395,7 +395,7 @@ ctf_type_align(ctf_file_t *fp, ctf_id_t const void *vmp; (void) ctf_get_ctt_size(fp, tp, &size, &increment); - vmp = (uchar_t *)tp + increment; + vmp = (const uchar_t *)tp + increment; if (LCTF_INFO_KIND(fp, tp->ctt_info) == CTF_K_STRUCT) n = MIN(n, 1); /* only use first member for structs */ Index: src/external/cddl/osnet/dist/lib/libctf/common/ctf_lib.c diff -u src/external/cddl/osnet/dist/lib/libctf/common/ctf_lib.c:1.4 src/external/cddl/osnet/dist/lib/libctf/common/ctf_lib.c:1.5 --- src/external/cddl/osnet/dist/lib/libctf/common/ctf_lib.c:1.4 Wed Feb 24 16:53:26 2010 +++ src/external/cddl/osnet/dist/lib/libctf/common/ctf_lib.c Sat Feb 7 15:30:03 2015 @@ -256,7 +256,7 @@ ctf_fdopen(int fd, int *errp) if (ctfsect.cts_data == MAP_FAILED) return (ctf_set_open_errno(errp, errno)); - ctfsect.cts_name = (char *)_CTF_SECTION; + ctfsect.cts_name = __UNCONST(_CTF_SECTION); ctfsect.cts_type = SHT_PROGBITS; ctfsect.cts_flags = SHF_ALLOC; ctfsect.cts_size = (size_t)st.st_size; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_aggregate.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_aggregate.c:1.3 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_aggregate.c:1.4 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_aggregate.c:1.3 Sat Feb 20 20:46:34 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_aggregate.c Sat Feb 7 15:30:03 2015 @@ -213,7 +213,7 @@ dt_aggregate_quantizedcmp(int64_t *lhs, { int nbuckets = DTRACE_QUANTIZE_NBUCKETS; long double ltotal = 0, rtotal = 0; - int64_t lzero, rzero; + int64_t lzero = 0, rzero = 0; uint_t i; for (i = 0; i < nbuckets; i++) { @@ -415,15 +415,15 @@ dt_aggregate_snap_cpu(dtrace_hdl_t *dtp, return (0); if (hash->dtah_hash == NULL) { - size_t size; + size_t size1; hash->dtah_size = DTRACE_AHASHSIZE; - size = hash->dtah_size * sizeof (dt_ahashent_t *); + size1 = hash->dtah_size * sizeof (dt_ahashent_t *); - if ((hash->dtah_hash = malloc(size)) == NULL) + if ((hash->dtah_hash = malloc(size1)) == NULL) return (dt_set_errno(dtp, EDT_NOMEM)); - bzero(hash->dtah_hash, size); + bzero(hash->dtah_hash, size1); } for (offs = 0; offs < buf->dtbd_size; ) { @@ -671,8 +671,8 @@ dtrace_aggregate_snap(dtrace_hdl_t *dtp) static int dt_aggregate_hashcmp(const void *lhs, const void *rhs) { - dt_ahashent_t *lh = *((dt_ahashent_t **)lhs); - dt_ahashent_t *rh = *((dt_ahashent_t **)rhs); + dt_ahashent_t *lh = *((dt_ahashent_t **)__UNCONST(lhs)); + dt_ahashent_t *rh = *((dt_ahashent_t **)__UNCONST(rhs)); dtrace_aggdesc_t *lagg = lh->dtahe_data.dtada_desc; dtrace_aggdesc_t *ragg = rh->dtahe_data.dtada_desc; @@ -688,8 +688,8 @@ dt_aggregate_hashcmp(const void *lhs, co static int dt_aggregate_varcmp(const void *lhs, const void *rhs) { - dt_ahashent_t *lh = *((dt_ahashent_t **)lhs); - dt_ahashent_t *rh = *((dt_ahashent_t **)rhs); + dt_ahashent_t *lh = *((dt_ahashent_t **)__UNCONST(lhs)); + dt_ahashent_t *rh = *((dt_ahashent_t **)__UNCONST(rhs)); dtrace_aggvarid_t lid, rid; lid = dt_aggregate_aggvarid(lh); @@ -707,16 +707,16 @@ dt_aggregate_varcmp(const void *lhs, con static int dt_aggregate_keycmp(const void *lhs, const void *rhs) { - dt_ahashent_t *lh = *((dt_ahashent_t **)lhs); - dt_ahashent_t *rh = *((dt_ahashent_t **)rhs); + dt_ahashent_t *lh = *((dt_ahashent_t **)__UNCONST(lhs)); + dt_ahashent_t *rh = *((dt_ahashent_t **)__UNCONST(rhs)); dtrace_aggdesc_t *lagg = lh->dtahe_data.dtada_desc; dtrace_aggdesc_t *ragg = rh->dtahe_data.dtada_desc; dtrace_recdesc_t *lrec, *rrec; char *ldata, *rdata; - int rval, i, j, keypos, nrecs; + int rval1, i, j, keypos, nrecs; - if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0) - return (rval); + if ((rval1 = dt_aggregate_hashcmp(lhs, rhs)) != 0) + return (rval1); nrecs = lagg->dtagd_nrecs - 1; assert(nrecs == ragg->dtagd_nrecs - 1); @@ -818,13 +818,13 @@ dt_aggregate_keycmp(const void *lhs, con static int dt_aggregate_valcmp(const void *lhs, const void *rhs) { - dt_ahashent_t *lh = *((dt_ahashent_t **)lhs); - dt_ahashent_t *rh = *((dt_ahashent_t **)rhs); + dt_ahashent_t *lh = *((dt_ahashent_t **)__UNCONST(lhs)); + dt_ahashent_t *rh = *((dt_ahashent_t **)__UNCONST(rhs)); dtrace_aggdesc_t *lagg = lh->dtahe_data.dtada_desc; dtrace_aggdesc_t *ragg = rh->dtahe_data.dtada_desc; caddr_t ldata = lh->dtahe_data.dtada_data; caddr_t rdata = rh->dtahe_data.dtada_data; - dtrace_recdesc_t *lrec, *rrec; + dtrace_recdesc_t *lrec = NULL, *rrec = NULL; int64_t *laddr, *raddr; int rval, i; @@ -975,8 +975,8 @@ dt_aggregate_varvalrevcmp(const void *lh static int dt_aggregate_bundlecmp(const void *lhs, const void *rhs) { - dt_ahashent_t **lh = *((dt_ahashent_t ***)lhs); - dt_ahashent_t **rh = *((dt_ahashent_t ***)rhs); + dt_ahashent_t **lh = *((dt_ahashent_t ***)__UNCONST(lhs)); + dt_ahashent_t **rh = *((dt_ahashent_t ***)__UNCONST(rhs)); int i, rval; if (dt_keysort) { @@ -1194,7 +1194,7 @@ dt_aggwalk_rval(dtrace_hdl_t *dtp, dt_ah return (0); } -void +static void dt_aggregate_qsort(dtrace_hdl_t *dtp, void *base, size_t nel, size_t width, int (*compar)(const void *, const void *)) { @@ -1503,9 +1503,9 @@ dtrace_aggregate_walk_joined(dtrace_hdl_ */ for (i = 0; i < naggvars; i++) { if (zaggdata[i].dtahe_size == 0) { - dtrace_aggvarid_t aggvar; + dtrace_aggvarid_t aggvar1; - aggvar = aggvars[(i - sortpos + naggvars) % naggvars]; + aggvar1 = aggvars[(i - sortpos + naggvars) % naggvars]; assert(zaggdata[i].dtahe_data.dtada_data == NULL); for (j = DTRACE_AGGIDNONE + 1; ; j++) { @@ -1515,7 +1515,7 @@ dtrace_aggregate_walk_joined(dtrace_hdl_ if (dt_aggid_lookup(dtp, j, &agg) != 0) break; - if (agg->dtagd_varid != aggvar) + if (agg->dtagd_varid != aggvar1) continue; /* @@ -1536,7 +1536,7 @@ dtrace_aggregate_walk_joined(dtrace_hdl_ } if (zaggdata[i].dtahe_size == 0) { - caddr_t data; + caddr_t data1; /* * We couldn't find this aggregation, meaning @@ -1557,8 +1557,8 @@ dtrace_aggregate_walk_joined(dtrace_hdl_ assert(j < naggvars); zaggdata[i] = zaggdata[j]; - data = zaggdata[i].dtahe_data.dtada_data; - assert(data != NULL); + data1 = zaggdata[i].dtahe_data.dtada_data; + assert(data1 != NULL); } } } Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_parser.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_parser.c:1.3 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_parser.c:1.4 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_parser.c:1.3 Sun Jan 12 12:49:30 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_parser.c Sat Feb 7 15:30:03 2015 @@ -198,7 +198,7 @@ dt_type_lookup(const char *s, dtrace_typ const char *p, *q, *end, *obj; for (p = s, end = s + strlen(s); *p != '\0'; p = q) { - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; /* skip leading whitespace prior to token */ if (p == end || (q = strpbrk(p + 1, delimiters)) == NULL) @@ -1080,7 +1080,8 @@ dt_node_is_ptrcompat(const dt_node_t *lp rkind = lkind; rref = lref; rfp = lfp; - } + } else + return 0; lp_is_void = ctf_type_encoding(lfp, lref, &e) == 0 && IS_VOID(e); rp_is_void = ctf_type_encoding(rfp, rref, &e) == 0 && IS_VOID(e); @@ -2515,7 +2516,7 @@ dt_node_provider(char *name, dt_node_t * "characters: %s\n", DTRACE_PROVNAMELEN - 1, name); } - if (isdigit(name[len - 1])) { + if (isdigit((unsigned char)name[len - 1])) { dnerror(dnp, D_PROV_BADNAME, "provider name may not " "end with a digit: %s\n", name); } @@ -3088,6 +3089,7 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla char n1[DT_TYPE_NAMELEN]; char n2[DT_TYPE_NAMELEN]; + uref = 0; /* * The expression E1[E2] is identical by definition to *((E1)+(E2)) so * we convert "[" to "+" and glue on "*" at the end (see K&R[A7.3.1]) @@ -4886,8 +4888,10 @@ yylabel(const char *label) yypcb->pcb_region = label; } +#if 0 int yywrap(void) { return (1); /* indicate that lex should return a zero token for EOF */ } +#endif Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c:1.3 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c:1.4 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c:1.3 Sat Feb 27 18:43:52 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c Sat Feb 7 15:30:03 2015 @@ -368,7 +368,7 @@ static void dt_header_fmt_macro(char *buf, const char *str) { for (;;) { - if (islower(*str)) { + if (islower((unsigned char)*str)) { *buf++ = *str++ + 'A' - 'a'; } else if (*str == '-') { *buf++ = '_'; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_as.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_as.c:1.1.1.1 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_as.c:1.2 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_as.c:1.1.1.1 Fri Feb 19 23:33:40 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_as.c Sat Feb 7 15:30:03 2015 @@ -259,6 +259,8 @@ dt_as(dt_pcb_t *pcb) default: xyerror(D_UNKNOWN, "internal error -- invalid link mode %u\n", dtp->dt_linkmode); + kmask = umask = 0; + kbits = ubits = -1u; } assert(pcb->pcb_difo == NULL); @@ -426,9 +428,12 @@ dt_as(dt_pcb_t *pcb) if ((idp = dip->di_extern) == NULL) continue; /* no relocation entry needed */ +/*###429 [cc] error: 'kbits' may be used uninitialized in this function [-Werror=maybe-uninitialized]%%%*/ if ((idp->di_flags & kmask) == kbits) { nodef = knodef; rp = krp++; +/*###432 [cc] error: 'ubits' may be used uninitialized in this function [-Werror=maybe-uninitialized]%%%*/ +/*###432 [cc] error: 'umask' may be used uninitialized in this function [-Werror=maybe-uninitialized]%%%*/ } else if ((idp->di_flags & umask) == ubits) { nodef = unodef; rp = urp++; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_list.h diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_list.h:1.1.1.1 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_list.h:1.2 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_list.h:1.1.1.1 Fri Feb 19 23:33:44 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_list.h Sat Feb 7 15:30:03 2015 @@ -38,8 +38,8 @@ typedef struct dt_list { struct dt_list *dl_next; } dt_list_t; -#define dt_list_prev(elem) ((void *)(((dt_list_t *)(elem))->dl_prev)) -#define dt_list_next(elem) ((void *)(((dt_list_t *)(elem))->dl_next)) +#define dt_list_prev(elem) ((void *)(((dt_list_t *)__UNCONST(elem))->dl_prev)) +#define dt_list_next(elem) ((void *)(((dt_list_t *)__UNCONST(elem))->dl_next)) extern void dt_list_append(dt_list_t *, void *); extern void dt_list_prepend(dt_list_t *, void *); Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cc.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cc.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cc.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cc.c:1.2 Sat Feb 20 19:49:54 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cc.c Sat Feb 7 15:30:03 2015 @@ -622,7 +622,7 @@ dt_action_printflike(dtrace_hdl_t *dtp, } if (str[0] == '\0') - str = DT_FREOPEN_RESTORE; + str = __UNCONST(DT_FREOPEN_RESTORE); } sdp->dtsd_fmtdata = dt_printf_create(dtp, str); @@ -1526,7 +1526,7 @@ dt_setcontext(dtrace_hdl_t *dtp, dtrace_ * On an error, dt_pid_create_probes() will set the error message * and tag -- we just have to longjmp() out of here. */ - if (isdigit(pdp->dtpd_provider[strlen(pdp->dtpd_provider) - 1]) && + if (isdigit((unsigned char)pdp->dtpd_provider[strlen(pdp->dtpd_provider) - 1]) && ((pvp = dt_provider_lookup(dtp, pdp->dtpd_provider)) == NULL || pvp->pv_desc.dtvd_priv.dtpp_flags & DTRACE_PRIV_PROC) && dt_pid_create_probes(pdp, dtp, yypcb) != 0) { @@ -1733,7 +1733,7 @@ dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) argv[argc++] = ipath; argv[argc++] = opath; #else - argv[argc++] = "-P"; + argv[argc++] = __UNCONST("-P"); #endif argv[argc] = NULL; @@ -2154,7 +2154,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex dt_node_t *dnp; dt_decl_t *ddp; dt_pcb_t pcb; - void *rv; + void *rv = NULL; int err; if ((fp == NULL && s == NULL) || (cflags & ~DTRACE_C_MASK) != 0) { Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cg.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cg.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cg.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cg.c:1.2 Sat Feb 20 19:49:54 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_cg.c Sat Feb 7 15:30:03 2015 @@ -407,7 +407,7 @@ static void dt_cg_store(dt_node_t *src, dt_irlist_t *dlp, dt_regset_t *drp, dt_node_t *dst) { ctf_encoding_t e; - dif_instr_t instr; + dif_instr_t instr = NULL; size_t size; int reg; @@ -1949,7 +1949,7 @@ void dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) { dif_instr_t instr; - dt_xlator_t *dxp; + dt_xlator_t *dxp = NULL; if (pcb->pcb_regs == NULL && (pcb->pcb_regs = dt_regset_create(pcb->pcb_hdl->dt_conf.dtc_difintregs)) == NULL) Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dis.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dis.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dis.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dis.c:1.2 Sun Jan 12 12:49:30 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dis.c Sat Feb 7 15:30:03 2015 @@ -418,7 +418,7 @@ dt_dis(const dtrace_difo_t *dp, FILE *fp ulong_t i = 0; char type[DT_TYPE_NAMELEN]; - (void) fprintf(fp, "\nDIFO 0x%p returns %s\n", (void *)dp, + (void) fprintf(fp, "\nDIFO %p returns %s\n", (const void *)dp, dt_dis_typestr(&dp->dtdo_rtype, type, sizeof (type))); (void) fprintf(fp, "%-3s %-8s %s\n", Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dof.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dof.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dof.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dof.c:1.2 Sat Feb 20 19:49:54 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_dof.c Sat Feb 7 15:30:03 2015 @@ -666,7 +666,7 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr stp != NULL; stp = dt_list_next(stp), last = edp) { dtrace_stmtdesc_t *sdp = stp->ds_desc; - dtrace_actdesc_t *ap = sdp->dtsd_action; + dtrace_actdesc_t *ap1 = sdp->dtsd_action; if (sdp->dtsd_fmtdata != NULL) { i = dtrace_printf_format(dtp, @@ -677,7 +677,7 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr if ((edp = sdp->dtsd_ecbdesc) == last) continue; /* same ecb as previous statement */ - for (i = 0, ap = edp->dted_action; ap; ap = ap->dtad_next) + for (i = 0, ap1 = edp->dted_action; ap1; ap1 = ap1->dtad_next) i++; maxacts = MAX(maxacts, i); @@ -718,7 +718,7 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr dof_stridx_t strndx = 0; dof_probedesc_t dofp; dof_ecbdesc_t dofe; - uint_t i; + uint_t i1; if ((edp = stp->ds_desc->dtsd_ecbdesc) == last) continue; /* same ecb as previous statement */ @@ -751,14 +751,14 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr * Now iterate through the action list generating DIFOs as * referenced therein and adding action descriptions to 'dofa'. */ - for (i = 0, ap = edp->dted_action; - ap != NULL; ap = ap->dtad_next, i++) { + for (i1 = 0, ap = edp->dted_action; + ap != NULL; ap = ap->dtad_next, i1++) { if (ap->dtad_difo != NULL) { - dofa[i].dofa_difo = + dofa[i1].dofa_difo = dof_add_difo(ddo, ap->dtad_difo); } else - dofa[i].dofa_difo = DOF_SECIDX_NONE; + dofa[i1].dofa_difo = DOF_SECIDX_NONE; /* * If the first action in a statement has format data, @@ -779,22 +779,22 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr } if (strndx != 0) { - dofa[i].dofa_arg = strndx; - dofa[i].dofa_strtab = ddo->ddo_strsec; + dofa[i1].dofa_arg = strndx; + dofa[i1].dofa_strtab = ddo->ddo_strsec; } else { - dofa[i].dofa_arg = ap->dtad_arg; - dofa[i].dofa_strtab = DOF_SECIDX_NONE; + dofa[i1].dofa_arg = ap->dtad_arg; + dofa[i1].dofa_strtab = DOF_SECIDX_NONE; } - dofa[i].dofa_kind = ap->dtad_kind; - dofa[i].dofa_ntuple = ap->dtad_ntuple; - dofa[i].dofa_uarg = ap->dtad_uarg; + dofa[i1].dofa_kind = ap->dtad_kind; + dofa[i1].dofa_ntuple = ap->dtad_ntuple; + dofa[i1].dofa_uarg = ap->dtad_uarg; } - if (i > 0) { + if (i1 > 0) { actsec = dof_add_lsect(ddo, dofa, DOF_SECT_ACTDESC, sizeof (uint64_t), 0, sizeof (dof_actdesc_t), - sizeof (dof_actdesc_t) * i); + sizeof (dof_actdesc_t) * i1); } /* Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_ident.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_ident.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_ident.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_ident.c:1.2 Sat Feb 20 19:49:54 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_ident.c Sat Feb 7 15:30:03 2015 @@ -202,7 +202,7 @@ dt_idcook_func(dt_node_t *dnp, dt_ident_ } for (p2 = p1; *p2 != '\0'; p2++) { - if (!isspace(*p2)) { + if (!isspace((unsigned char)*p2)) { i++; break; } @@ -263,7 +263,7 @@ dt_idcook_func(dt_node_t *dnp, dt_ident_ * arguments may not follow optional arguments. */ for (i = 0; i < isp->dis_argc; i++, p1 = p2) { - while (isspace(*p1)) + while (isspace((unsigned char)*p1)) p1++; /* skip leading whitespace */ if ((p2 = strchr(p1, ',')) == NULL) Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_lex.l diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_lex.l:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_lex.l:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_lex.l:1.2 Sat Feb 20 19:49:54 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_lex.l Sat Feb 7 15:30:03 2015 @@ -268,8 +268,8 @@ if (yypcb->pcb_token != 0) { * If the macro text is not a string an begins with a * digit or a +/- sign, process it as an integer token. */ - if (isdigit(v[0]) || v[0] == '-' || v[0] == '+') { - if (isdigit(v[0])) + if (isdigit((unsigned char)v[0]) || v[0] == '-' || v[0] == '+') { + if (isdigit((unsigned char)v[0])) yyintprefix = 0; else yyintprefix = *v++; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pragma.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pragma.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pragma.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pragma.c:1.2 Sat Feb 20 19:49:55 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pragma.c Sat Feb 7 15:30:03 2015 @@ -77,7 +77,7 @@ static void dt_pragma_attributes(const char *prname, dt_node_t *dnp) { dtrace_hdl_t *dtp = yypcb->pcb_hdl; - dtrace_attribute_t attr, *a; + dtrace_attribute_t attr, *a = NULL; dt_provider_t *pvp; const char *name, *part; dt_ident_t *idp; @@ -211,7 +211,7 @@ dt_pragma_depends(const char *prname, dt { dtrace_hdl_t *dtp = yypcb->pcb_hdl; dt_node_t *nnp = cnp ? cnp->dn_list : NULL; - int found; + int found = 0; dt_lib_depend_t *dld; char lib[MAXPATHLEN]; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_work.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_work.c:1.2 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_work.c:1.3 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_work.c:1.2 Sat Feb 20 19:49:55 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_work.c Sat Feb 7 15:30:03 2015 @@ -294,6 +294,7 @@ dtrace_work(dtrace_hdl_t *dtp, FILE *fp, break; case -1: + default: return (DTRACE_WORKSTATUS_ERROR); } Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c:1.5 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c:1.6 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c:1.5 Sun Jan 12 12:49:30 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c Sat Feb 7 15:30:03 2015 @@ -34,6 +34,7 @@ #include <alloca.h> #endif #include <dt_impl.h> +#include <dt_printf.h> #define DT_MASK_LO 0x00000000FFFFFFFFULL @@ -476,18 +477,18 @@ out: } static int -dt_nullprobe() +dt_nullprobe(void) { return (DTRACE_CONSUME_THIS); } static int -dt_nullrec() +dt_nullrec(void) { return (DTRACE_CONSUME_NEXT); } -int +static int dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val, uint64_t normal, long double total, char positives, char negatives) { @@ -708,7 +709,7 @@ dt_print_stddev(dtrace_hdl_t *dtp, FILE } /*ARGSUSED*/ -int +static int dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr, size_t nbytes, int width, int quiet, int raw) { @@ -737,7 +738,7 @@ dt_print_bytes(dtrace_hdl_t *dtp, FILE * * have meaning for the terminal and for which isprint(3C) and * isspace(3C) return 0. */ - if (isprint(c[i]) || isspace(c[i]) || + if (isprint((unsigned char)c[i]) || isspace((unsigned char)c[i]) || c[i] == '\b' || c[i] == '\a') continue; @@ -1151,7 +1152,7 @@ dt_print_umod(dtrace_hdl_t *dtp, FILE *f #endif } -int +static int dt_print_memory(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) { int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET); @@ -1209,7 +1210,7 @@ dt_print_type_width(const char *name, ct if ((p = strchr(buf, '[')) != NULL) p[-1] = '\0'; else - p = ""; + p = __UNCONST(""); sz += strlen(p); @@ -1240,7 +1241,7 @@ dt_print_type_data(dt_type_cbdata_t *cbd if ((p = strchr(buf, '[')) != NULL) p[-1] = '\0'; else - p = ""; + p = __UNCONST(""); if (cbdatap->f_type) { int type_width = roundup(cbdatap->type_width + 1, 4); @@ -1255,7 +1256,6 @@ dt_print_type_data(dt_type_cbdata_t *cbd dt_type_cbdata_t cbdata; ctf_arinfo_t arinfo; ctf_encoding_t cte; - uintptr_t *up; void *vp = addr; cbdata = *cbdatap; cbdata.name = ""; @@ -1276,7 +1276,7 @@ dt_print_type_data(dt_type_cbdata_t *cbd if ((cte.cte_format & CTF_INT_SIGNED) != 0) switch (cte.cte_bits) { case 8: - if (isprint(*((char *) vp))) + if (isprint(*((unsigned char *) vp))) dt_printf(cbdatap->dtp, cbdatap->fp, "'%c', ", *((char *) vp)); dt_printf(cbdatap->dtp, cbdatap->fp, "%d (0x%x);\n", *((char *) vp), *((char *) vp)); break; @@ -1385,7 +1385,6 @@ dt_print_type_data(dt_type_cbdata_t *cbd static int dt_print_type(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) { - caddr_t addrend; char *p; dtrace_typeinfo_t dtt; dt_type_cbdata_t cbdata; @@ -1535,7 +1534,7 @@ dt_normalize_agg(const dtrace_aggdata_t if (agg->dtagd_varid != id) return (DTRACE_AGGWALK_NEXT); - ((dtrace_aggdata_t *)aggdata)->dtada_normal = normal->dtnd_normal; + ((dtrace_aggdata_t *)__UNCONST(aggdata))->dtada_normal = normal->dtnd_normal; return (DTRACE_AGGWALK_NORMALIZE); } @@ -1784,7 +1783,7 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE * return (err); } -int +static int dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg) { int i, aggact = 0; @@ -1885,7 +1884,7 @@ dt_print_agg(const dtrace_aggdata_t *agg return (dt_print_aggs(&aggdata, 1, arg)); } -int +static int dt_setopt(dtrace_hdl_t *dtp, const dtrace_probedata_t *data, const char *option, const char *value) { @@ -2003,22 +2002,22 @@ again: addr = data.dtpda_data; if (act == DTRACEACT_LIBACT) { - uint64_t arg = rec->dtrd_arg; - dtrace_aggvarid_t id; + uint64_t arg1 = rec->dtrd_arg; + dtrace_aggvarid_t id1; - switch (arg) { + switch (arg1) { case DT_ACT_CLEAR: /* LINTED - alignment */ - id = *((dtrace_aggvarid_t *)addr); + id1 = *((dtrace_aggvarid_t *)addr); (void) dtrace_aggregate_walk(dtp, - dt_clear_agg, &id); + dt_clear_agg, &id1); continue; case DT_ACT_DENORMALIZE: /* LINTED - alignment */ - id = *((dtrace_aggvarid_t *)addr); + id1 = *((dtrace_aggvarid_t *)addr); (void) dtrace_aggregate_walk(dtp, - dt_denormalize_agg, &id); + dt_denormalize_agg, &id1); continue; case DT_ACT_FTRUNCATE: @@ -2058,7 +2057,7 @@ again: valsize = valrec->dtrd_size; if (valrec->dtrd_action != act || - valrec->dtrd_arg != arg) { + valrec->dtrd_arg != arg1) { return (dt_set_errno(dtp, EDT_BADSETOPT)); } @@ -2067,7 +2066,7 @@ again: val = buf->dtbd_data + offs + valrec->dtrd_offset; } else { - val = "1"; + val = __UNCONST("1"); } rv = dt_setopt(dtp, &data, addr, val); Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_options.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_options.c:1.5 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_options.c:1.6 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_options.c:1.5 Sun Jan 12 12:49:30 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_options.c Sat Feb 7 15:30:03 2015 @@ -786,7 +786,7 @@ int dt_options_load(dtrace_hdl_t *dtp) { dof_hdr_t hdr, *dof; - dof_sec_t *sec; + dof_sec_t *sec = NULL; size_t offs; int i; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c:1.5 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c:1.6 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c:1.5 Mon Mar 1 06:19:41 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c Sat Feb 7 15:30:03 2015 @@ -65,6 +65,7 @@ typedef struct dt_pid_probe { * Compose the lmid and object name into the canonical representation. We * omit the lmid for the default link map for convenience. */ +#if 0 static void dt_pid_objname(char *buf, size_t len, Lmid_t lmid, const char *obj) { @@ -77,6 +78,7 @@ dt_pid_objname(char *buf, size_t len, Lm (void) strncpy(buf, obj, len); #endif } +#endif static int dt_pid_error(dtrace_hdl_t *dtp, dt_pcb_t *pcb, dt_proc_t *dpr, @@ -105,6 +107,7 @@ dt_pid_error(dtrace_hdl_t *dtp, dt_pcb_t return (1); } +#if 0 static int dt_pid_per_sym(dt_pid_probe_t *pp, const GElf_Sym *symp, const char *func) { @@ -460,7 +463,9 @@ dt_pid_mod_filt(void *arg, const prmap_t return (0); } +#endif +#if 0 static const prmap_t * dt_pid_fix_mod(dtrace_probedesc_t *pdp, struct ps_prochandle *P) { @@ -511,6 +516,7 @@ pmp = NULL; return (pmp); } +#endif static int @@ -605,6 +611,7 @@ dt_pid_create_pid_probes(dtrace_probedes #endif } +#if 0 static int dt_pid_usdt_mapping(void *data, const prmap_t *pmp, const char *oname) { @@ -685,6 +692,7 @@ dt_pid_usdt_mapping(void *data, const pr return ENODEV; #endif } +#endif static int dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp, @@ -730,7 +738,7 @@ dt_pid_get_pid(dtrace_probedesc_t *pdp, char *c, *last = NULL, *end; for (c = &pdp->dtpd_provider[0]; *c != '\0'; c++) { - if (!isdigit(*c)) + if (!isdigit((unsigned char)*c)) last = c; } Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c:1.5 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c:1.6 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c:1.5 Thu Mar 27 15:34:39 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c Sat Feb 7 15:30:03 2015 @@ -823,7 +823,7 @@ dt_printf_create(dtrace_hdl_t *dtp, cons goto fmt_switch; } - for (n = 0; isdigit(c); c = *++p) + for (n = 0; isdigit((unsigned char)c); c = *++p) n = n * 10 + c - '0'; if (dot) @@ -1018,7 +1018,7 @@ dt_printf_validate(dt_pfargv_t *pfv, uin int dync = 0; char vname[64]; - dt_node_t *vnp; + dt_node_t *vnp = NULL; if (pfc == NULL) continue; /* no checking if argd is just a prefix */ @@ -1271,11 +1271,11 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE { dt_pfargd_t *pfd = pfv->pfv_argv; const dtrace_recdesc_t *recp = recs; - const dtrace_aggdata_t *aggdata; + const dtrace_aggdata_t *aggdata = NULL; dtrace_aggdesc_t *agg; caddr_t lim = (caddr_t)buf + len, limit; char format[64] = "%"; - int i, aggrec, curagg = -1; + int i, aggrec = 0, curagg = -1; uint64_t normal; /* @@ -1311,7 +1311,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE dt_pfprint_f *func; caddr_t addr; size_t size; - uint32_t flags; + uint32_t flags = 0; if (pfd->pfd_preflen != 0) { char *tmp = alloca(pfd->pfd_preflen + 1); @@ -1516,7 +1516,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE return ((int)(recp - recs)); } -int +static int dtrace_sprintf(dtrace_hdl_t *dtp, FILE *fp, void *fmtdata, const dtrace_recdesc_t *recp, uint_t nrecs, const void *buf, size_t len) { @@ -1574,7 +1574,9 @@ dtrace_freopen(dtrace_hdl_t *dtp, FILE * const dtrace_probedata_t *data, const dtrace_recdesc_t *recp, uint_t nrecs, const void *buf, size_t len) { +#if defined(sun) char selfbuf[40], restorebuf[40], *filename; +#endif FILE *nfp; int rval, errval; dt_pfargv_t *pfv = fmtdata; Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c:1.5 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c:1.6 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c:1.5 Mon Mar 1 06:19:41 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c Sat Feb 7 15:30:03 2015 @@ -89,6 +89,17 @@ #include <dt_pid.h> #include <dt_impl.h> +int proc_setflags(struct proc_handle *, int); +int proc_create(const char *file, char * const *, proc_child_func *, + void *, struct proc_handle **); +int proc_detach(struct proc_handle *); +int proc_getflags(struct proc_handle *); +int proc_wait(struct proc_handle *); +pid_t proc_getpid(struct proc_handle *); +int proc_attach(pid_t, int, struct proc_handle **); +int proc_state(struct proc_handle *); +int proc_clearflags(struct proc_handle *, int); +int proc_continue(struct proc_handle *); /* XXX TBD needs libproc */ /* Stub proc functions for now */ int @@ -210,6 +221,7 @@ dt_proc_bpdestroy(dt_proc_t *dpr, int de #endif dt_bkpt_t *dbp, *nbp; + __USE(state); assert(DT_MUTEX_HELD(&dpr->dpr_lock)); for (dbp = dt_list_next(&dpr->dpr_bps); dbp != NULL; dbp = nbp) { @@ -355,6 +367,7 @@ dt_proc_stop(dt_proc_t *dpr, uint8_t why } } +#if defined(sun) /*ARGSUSED*/ static void dt_proc_bpmain(dtrace_hdl_t *dtp, dt_proc_t *dpr, const char *fname) @@ -363,7 +376,6 @@ dt_proc_bpmain(dtrace_hdl_t *dtp, dt_pro dt_proc_stop(dpr, DT_PROC_STOP_MAIN); } -#if defined(sun) static void dt_proc_rdevent(dtrace_hdl_t *dtp, dt_proc_t *dpr, const char *evname) { @@ -864,6 +876,7 @@ dt_proc_destroy(dtrace_hdl_t *dtp, struc rflag = PRELEASE_HANG; #else rflag = 0 /* XXX */; + __USE(rflag); #endif } else { dt_dprintf("releasing pid %d\n", (int)dpr->dpr_pid); Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c:1.6 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c:1.7 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c:1.6 Thu Mar 27 22:58:36 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c Sat Feb 7 15:30:03 2015 @@ -498,6 +498,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_ int ret = 0; uint_t nshdr; + memset(&de, 0, sizeof(de)); if (prepare_elf32(dtp, dof, &de) != 0) return (-1); /* errno is set for us */ @@ -646,6 +647,7 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_ int ret = 0; uint_t nshdr; + memset(&de, 0, sizeof(de)); if (prepare_elf64(dtp, dof, &de) != 0) return (-1); /* errno is set for us */ Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c:1.7 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c:1.8 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c:1.7 Mon Feb 13 08:05:36 2012 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c Sat Feb 7 15:30:03 2015 @@ -851,8 +851,10 @@ dt_module_update(dtrace_hdl_t *dtp, cons (void) snprintf(fname, sizeof (fname), "%s/%s/object", OBJFS_ROOT, name); #else +#if 0 GElf_Phdr ph; int i; +#endif int mib_osrel[2] = { CTL_KERN, KERN_OSRELEASE }; int mib_mach[2] = { CTL_HW, HW_MACHINE }; char osrel[64]; @@ -989,7 +991,9 @@ void dtrace_update(dtrace_hdl_t *dtp) { dt_module_t *dmp; +#if defined(sun) DIR *dirp; +#endif #if defined(__FreeBSD__) int fileid; #endif Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.4 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.5 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.4 Thu Mar 4 20:53:15 2010 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c Sat Feb 7 15:30:03 2015 @@ -987,8 +987,10 @@ dt_vopen(int version, int flags, int *er dt_fdlist_t df = { NULL, 0, 0 }; +#if defined(sun) char isadef[32], utsdef[32]; char s1[64], s2[64]; +#endif if (version <= 0) return (set_open_errno(dtp, errp, EINVAL)); @@ -1218,12 +1220,12 @@ alloc: */ #if !defined(sun) { - char bootfile[MAXPATHLEN]; char *p; +#if 0 /* XXX debug */ + char bootfile[MAXPATHLEN]; int i; size_t len = sizeof(bootfile); -#if 0 /* XXX debug */ /* This call shouldn't fail, but use a default just in case. */ if (sysctlbyname("kern.bootfile", bootfile, &len, NULL, 0) != 0) strlcpy(bootfile, "kernel", sizeof(bootfile)); Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c:1.8 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c:1.9 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c:1.8 Thu Mar 27 11:50:48 2014 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c Sat Feb 7 15:30:03 2015 @@ -104,7 +104,7 @@ dtrace_xstr2desc(dtrace_hdl_t *dtp, dtra v++; } - if (isdigit(v[1])) { + if (isdigit((unsigned char)v[1])) { long i; errno = 0; @@ -389,7 +389,7 @@ dt_version_str2num(const char *s, dt_ver char c; while ((c = *s++) != '\0') { - if (isdigit(c)) + if (isdigit((unsigned char)c)) n[i] = n[i] * 10 + c - '0'; else if (c != '.' || i++ >= sizeof (n) / sizeof (n[0]) - 1) return (-1); Index: src/external/cddl/osnet/dist/lib/libgen/common/gmatch.c diff -u src/external/cddl/osnet/dist/lib/libgen/common/gmatch.c:1.3 src/external/cddl/osnet/dist/lib/libgen/common/gmatch.c:1.4 --- src/external/cddl/osnet/dist/lib/libgen/common/gmatch.c:1.3 Sun May 15 14:33:33 2011 +++ src/external/cddl/osnet/dist/lib/libgen/common/gmatch.c Sat Feb 7 15:30:03 2015 @@ -63,6 +63,7 @@ return (0); \ p += n; +int gmatch(const char *, const char *); int gmatch(const char *s, const char *p) { Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c:1.7 src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c:1.8 --- src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c:1.7 Sun Mar 9 13:04:00 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c Sat Feb 7 15:30:03 2015 @@ -81,7 +81,7 @@ struct ctf_buf { static int target_requires_swap; /*PRINTFLIKE1*/ -static void +static void __printflike(1, 2) parseterminate(const char *fmt, ...) { static char msgbuf[1024]; /* sigh */ @@ -496,7 +496,7 @@ write_type(void *arg1, void *arg2) if (i > CTF_MAX_VLEN) { terminate("function %s has too many args: %d > %d\n", - i, CTF_MAX_VLEN); + tdesc_name(tp), i, CTF_MAX_VLEN); } ctt.ctt_info = CTF_TYPE_INFO(CTF_K_FUNCTION, isroot, i); @@ -825,8 +825,9 @@ count_types(ctf_header_t *h, caddr_t dat case CTF_K_UNKNOWN: break; default: - parseterminate("Unknown CTF type %d (#%d) at %#x", - CTF_INFO_KIND(ctt->ctt_info), count, dptr - data); + parseterminate("Unknown CTF type %d (#%d) at %#jx", + CTF_INFO_KIND(ctt->ctt_info), count, + (intmax_t)(dptr - data)); } dptr += increment; @@ -913,8 +914,8 @@ resurrect_objects(ctf_header_t *h, tdata if (!(sym = symit_next(si, STT_OBJECT)) && id != 0) { parseterminate( - "Unexpected end of object symbols at %x of %x", - dptr - buf, bufsz); + "Unexpected end of object symbols at %ju of %zu", + (intmax_t)(dptr - buf), bufsz); } if (id == 0) { @@ -1336,8 +1337,9 @@ decompress_ctf(caddr_t cbuf, size_t cbuf return (0); } - debug(3, "reflated %lu bytes to %lu, pointer at %d\n", - zstr.total_in, zstr.total_out, (caddr_t)zstr.next_in - cbuf); + debug(3, "reflated %lu bytes to %lu, pointer at 0x%jx\n", + zstr.total_in, zstr.total_out, + (intmax_t)((caddr_t)zstr.next_in - cbuf)); return (zstr.total_out); } @@ -1381,7 +1383,7 @@ ctf_load(char *file, caddr_t buf, size_t if ((actual = decompress_ctf(buf, bufsz, ctfdata, ctfdatasz)) != ctfdatasz) { parseterminate("Corrupt CTF - short decompression " - "(was %d, expecting %d)", actual, ctfdatasz); + "(was %zu, expecting %zu)", actual, ctfdatasz); } } else { ctfdata = buf; Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.9 src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.10 --- src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.9 Sun Mar 9 15:14:15 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c Sat Feb 7 15:30:03 2015 @@ -216,11 +216,13 @@ static char *outfile = NULL; static char *tmpname = NULL; static int dynsym; int debug_level = DEBUG_LEVEL; +#if 0 static size_t maxpgsize = 0x400000; +#endif static int maxslots = MERGE_PHASE1_MAX_SLOTS; -void +static void usage(void) { (void) fprintf(stderr, @@ -391,7 +393,8 @@ wip_add_work(wip_t *slot, tdata_t *pow) slot->wip_td = pow; slot->wip_nmerged = 1; } else { - debug(2, "%d: merging %p into %p\n", pthread_self(), + debug(2, "0x%jx: merging %p into %p\n", + (uintptr_t)pthread_self(), (void *)pow, (void *)slot->wip_td); merge_into_master(pow, slot->wip_td, NULL, 0); @@ -461,8 +464,8 @@ worker_runphase2(workqueue_t *wq) pthread_cond_broadcast(&wq->wq_work_avail); pthread_mutex_unlock(&wq->wq_queue_lock); - debug(2, "%d: entering p2 completion barrier\n", - pthread_self()); + debug(2, "0x%jx: entering p2 completion barrier\n", + (uintptr_t)pthread_self()); if (barrier_wait(&wq->wq_bar1)) { pthread_mutex_lock(&wq->wq_queue_lock); wq->wq_alldone = 1; @@ -489,7 +492,8 @@ worker_runphase2(workqueue_t *wq) pthread_mutex_unlock(&wq->wq_queue_lock); - debug(2, "%d: merging %p into %p\n", pthread_self(), + debug(2, "0x%jx: merging %p into %p\n", + (uintptr_t)pthread_self(), (void *)pow1, (void *)pow2); merge_into_master(pow1, pow2, NULL, 0); tdata_free(pow1); @@ -507,9 +511,9 @@ worker_runphase2(workqueue_t *wq) wq->wq_lastdonebatch = batchid; fifo_add(wq->wq_queue, pow2); - debug(2, "%d: added %p to queue, len now %d, ninqueue %d\n", - pthread_self(), (void *)pow2, fifo_len(wq->wq_queue), - wq->wq_ninqueue); + debug(2, "0x%jx: added %p to queue, len now %d, ninqueue %d\n", + (uintptr_t)pthread_self(), (void *)pow2, + fifo_len(wq->wq_queue), wq->wq_ninqueue); pthread_cond_broadcast(&wq->wq_done_cv); pthread_cond_signal(&wq->wq_work_avail); pthread_mutex_unlock(&wq->wq_queue_lock); @@ -524,25 +528,27 @@ worker_thread(workqueue_t *wq) { worker_runphase1(wq); - debug(2, "%d: entering first barrier\n", pthread_self()); + debug(2, "0x%jx: entering first barrier\n", (uintptr_t)pthread_self()); if (barrier_wait(&wq->wq_bar1)) { - debug(2, "%d: doing work in first barrier\n", pthread_self()); + debug(2, "0x%jx: doing work in first barrier\n", + (uintptr_t)pthread_self()); finalize_phase_one(wq); init_phase_two(wq); - debug(2, "%d: ninqueue is %d, %d on queue\n", pthread_self(), + debug(2, "0x%jx: ninqueue is %d, %d on queue\n", + (uintptr_t)pthread_self(), wq->wq_ninqueue, fifo_len(wq->wq_queue)); } - debug(2, "%d: entering second barrier\n", pthread_self()); + debug(2, "0x%jx: entering second barrier\n", (uintptr_t)pthread_self()); (void) barrier_wait(&wq->wq_bar2); - debug(2, "%d: phase 1 complete\n", pthread_self()); + debug(2, "0x%jx: phase 1 complete\n", (uintptr_t)pthread_self()); worker_runphase2(wq); } @@ -566,7 +572,8 @@ merge_ctf_cb(tdata_t *td, char *name, vo } fifo_add(wq->wq_queue, td); - debug(1, "Thread %d announcing %s\n", pthread_self(), name); + debug(1, "Thread 0x%jx announcing %s\n", (uintptr_t)pthread_self(), + name); pthread_cond_broadcast(&wq->wq_work_avail); pthread_mutex_unlock(&wq->wq_queue_lock); @@ -741,8 +748,8 @@ join_threads(workqueue_t *wq) static int strcompare(const void *p1, const void *p2) { - char *s1 = *((char **)p1); - char *s2 = *((char **)p2); + const char *s1 = *((const char * const *)p1); + const char *s2 = *((const char * const *)p2); return (strcmp(s1, s2)); } @@ -803,7 +810,7 @@ main(int argc, char **argv) case 'L': /* Label merged types with getenv(`label`) */ if ((label = getenv(optarg)) == NULL) - label = CTF_DEFAULT_LABEL; + label = __UNCONST(CTF_DEFAULT_LABEL); break; case 'o': /* Place merged types in CTF section in `outfile' */ @@ -897,7 +904,7 @@ main(int argc, char **argv) for (i = 0; i < nifiles; i++) tifiles[i] = argv[optind + i]; - qsort(tifiles, nifiles, sizeof (char *), (int (*)())strcompare); + qsort(tifiles, nifiles, sizeof (char *), strcompare); ifiles[0] = tifiles[0]; for (idx = 0, tidx = 1; tidx < nifiles; tidx++) { Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctftools.h diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctftools.h:1.3 src/external/cddl/osnet/dist/tools/ctf/cvt/ctftools.h:1.4 --- src/external/cddl/osnet/dist/tools/ctf/cvt/ctftools.h:1.3 Sun Mar 9 13:04:00 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctftools.h Sat Feb 7 15:30:03 2015 @@ -439,13 +439,13 @@ int streq(const char *, const char *); int findelfsecidx(Elf *, const char *, const char *); size_t elf_ptrsz(Elf *); char *mktmpname(const char *, const char *); -void terminate(const char *, ...); -void aborterr(const char *, ...); +void terminate(const char *, ...) __printflike(1, 2) __dead; +void aborterr(const char *, ...) __printflike(1, 2); void set_terminate_cleanup(void (*)(void)); -void elfterminate(const char *, const char *, ...); -void warning(const char *, ...); +void elfterminate(const char *, const char *, ...) __printflike(2, 3); +void warning(const char *, ...) __printflike(1, 2); void vadebug(int, const char *, va_list); -void debug(int, const char *, ...); +void debug(int, const char *, ...) __printflike(2, 3); void watch_dump(int); Index: src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.11 src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.12 --- src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.11 Sat Nov 1 19:21:31 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c Sat Feb 7 15:30:03 2015 @@ -289,8 +289,8 @@ die_sibling(dwarf_t *dw, Dwarf_Die die) else if (rc == DW_DLV_NO_ENTRY) return (NULL); - terminate("die %llu: failed to find type sibling: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to find type sibling: %s\n", + (uintmax_t)die_off(dw, die), dwarf_errmsg(dw->dw_err)); /*NOTREACHED*/ return (NULL); } @@ -306,8 +306,8 @@ die_child(dwarf_t *dw, Dwarf_Die die) else if (rc == DW_DLV_NO_ENTRY) return (NULL); - terminate("die %llu: failed to find type child: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to find type child: %s\n", + (uintmax_t)die_off(dw, die), dwarf_errmsg(dw->dw_err)); /*NOTREACHED*/ return (NULL); } @@ -320,8 +320,8 @@ die_tag(dwarf_t *dw, Dwarf_Die die) if (dwarf_tag(die, &tag, &dw->dw_err) == DW_DLV_OK) return (tag); - terminate("die %llu: failed to get tag for type: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get tag for type: %s\n", + (uintmax_t)die_off(dw, die), dwarf_errmsg(dw->dw_err)); /*NOTREACHED*/ return (0); } @@ -336,15 +336,16 @@ die_attr(dwarf_t *dw, Dwarf_Die die, Dwa return (attr); } else if (rc == DW_DLV_NO_ENTRY) { if (req) { - terminate("die %llu: no attr 0x%x\n", die_off(dw, die), + terminate("die %ju: no attr 0x%x\n", + (uintmax_t)die_off(dw, die), name); } else { return (NULL); } } - terminate("die %llu: failed to get attribute for type: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get attribute for type: %s\n", + (uintmax_t)die_off(dw, die), dwarf_errmsg(dw->dw_err)); /*NOTREACHED*/ return (NULL); } @@ -356,8 +357,9 @@ die_signed(dwarf_t *dw, Dwarf_Die die, D *valp = 0; if (dwarf_attrval_signed(die, name, valp, &dw->dw_err) != DW_DLV_OK) { if (req) - terminate("die %llu: failed to get signed: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get signed: %s\n", + (uintmax_t)die_off(dw, die), + dwarf_errmsg(dw->dw_err)); return (0); } @@ -371,8 +373,9 @@ die_unsigned(dwarf_t *dw, Dwarf_Die die, *valp = 0; if (dwarf_attrval_unsigned(die, name, valp, &dw->dw_err) != DW_DLV_OK) { if (req) - terminate("die %llu: failed to get unsigned: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get unsigned: %s\n", + (uintmax_t)die_off(dw, die), + dwarf_errmsg(dw->dw_err)); return (0); } @@ -386,8 +389,9 @@ die_bool(dwarf_t *dw, Dwarf_Die die, Dwa if (dwarf_attrval_flag(die, name, valp, &dw->dw_err) != DW_DLV_OK) { if (req) - terminate("die %llu: failed to get flag: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get flag: %s\n", + (uintmax_t)die_off(dw, die), + dwarf_errmsg(dw->dw_err)); return (0); } @@ -402,8 +406,9 @@ die_string(dwarf_t *dw, Dwarf_Die die, D if (dwarf_attrval_string(die, name, &str, &dw->dw_err) != DW_DLV_OK || str == NULL) { if (req) - terminate("die %llu: failed to get string: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get string: %s\n", + (uintmax_t)die_off(dw, die), + dwarf_errmsg(dw->dw_err)); else *strp = NULL; return (0); @@ -416,11 +421,11 @@ die_string(dwarf_t *dw, Dwarf_Die die, D static Dwarf_Off die_attr_ref(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name) { - Dwarf_Off off; + Dwarf_Unsigned off; if (dwarf_attrval_unsigned(die, name, &off, &dw->dw_err) != DW_DLV_OK) { - terminate("die %llu: failed to get ref: %s\n", - die_off(dw, die), dwarf_errmsg(dw->dw_err)); + terminate("die %ju: failed to get ref: %s\n", + (uintmax_t)die_off(dw, die), dwarf_errmsg(dw->dw_err)); } return (off); @@ -496,8 +501,9 @@ die_mem_offset(dwarf_t *dw, Dwarf_Die di Dwarf_Half form; if (name != DW_AT_data_member_location) - terminate("die %llu: can only process attribute " - "DW_AT_data_member_location\n", die_off(dw, die)); + terminate("die %ju: can only process attribute " + "DW_AT_data_member_location\n", + (uintmax_t)die_off(dw, die)); if ((at = die_attr(dw, die, name, 0)) == NULL) return (0); @@ -520,9 +526,9 @@ die_mem_offset(dwarf_t *dw, Dwarf_Die di if (dwarf_loclist(at, &loc, &locnum, &dw->dw_err) != DW_DLV_OK) return (0); if (locnum != 1 || loc->ld_s->lr_atom != DW_OP_plus_uconst) { - terminate("die %llu: cannot parse member offset with " + terminate("die %ju: cannot parse member offset with " "operator other than DW_OP_plus_uconst\n", - die_off(dw, die)); + (uintmax_t)die_off(dw, die)); } *valp = loc->ld_s->lr_number; if (loc != NULL) { @@ -556,8 +562,8 @@ die_mem_offset(dwarf_t *dw, Dwarf_Die di break; default: - terminate("die %llu: cannot parse member offset with form " - "%u\n", die_off(dw, die), form); + terminate("die %ju: cannot parse member offset with form " + "%u\n", (uintmax_t)die_off(dw, die), form); } return (1); @@ -661,12 +667,12 @@ tdesc_array_create(dwarf_t *dw, Dwarf_Di } else if (die_tag(dw, dim2) == DW_TAG_subrange_type) { ctdp = xcalloc(sizeof (tdesc_t)); ctdp->t_id = mfgtid_next(dw); - debug(3, "die %llu: creating new type %u for sub-dimension\n", - die_off(dw, dim2), ctdp->t_id); + debug(3, "die %ju: creating new type %u for sub-dimension\n", + (uintmax_t)die_off(dw, dim2), ctdp->t_id); tdesc_array_create(dw, dim2, arrtdp, ctdp); } else { - terminate("die %llu: unexpected non-subrange node in array\n", - die_off(dw, dim2)); + terminate("die %ju: unexpected non-subrange node in array\n", + (uintmax_t)die_off(dw, dim2)); } dimtdp->t_type = ARRAY; @@ -715,11 +721,13 @@ die_array_create(dwarf_t *dw, Dwarf_Die Dwarf_Unsigned uval; Dwarf_Die dim; - debug(3, "die %llu <%llx>: creating array\n", off, off); + debug(3, "die %ju <%jx>: creating array\n", + (uintmax_t)off, (uintmax_t)off); if ((dim = die_child(dw, arr)) == NULL || die_tag(dw, dim) != DW_TAG_subrange_type) - terminate("die %llu: failed to retrieve array bounds\n", off); + terminate("die %ju: failed to retrieve array bounds\n", + (uintmax_t)off); tdesc_array_create(dw, dim, arrtdp, tdp); @@ -753,8 +761,8 @@ die_array_create(dwarf_t *dw, Dwarf_Die tdp->t_flags |= flags; } - debug(3, "die %llu <%llx>: array nelems %u size %u\n", off, off, - tdp->t_ardef->ad_nelems, tdp->t_size); + debug(3, "die %ju <%jx>: array nelems %u size %u\n", (uintmax_t)off, + (uintmax_t)off, tdp->t_ardef->ad_nelems, tdp->t_size); } /*ARGSUSED1*/ @@ -815,7 +823,7 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d Dwarf_Unsigned uval; Dwarf_Signed sval; - debug(3, "die %llu: creating enum\n", off); + debug(3, "die %ju: creating enum\n", (uintmax_t)off); tdp->t_type = (die_isdecl(dw, die) ? FORWARD : ENUM); if (tdp->t_type != ENUM) @@ -851,12 +859,14 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d &uval, 0)) { el->el_number = uval; } else { - terminate("die %llu: enum %llu: member without " - "value\n", off, die_off(dw, mem)); + terminate("die %ju: enum %ju: member without " + "value\n", (uintmax_t)off, + (uintmax_t)die_off(dw, mem)); } - debug(3, "die %llu: enum %llu: created %s = %d\n", off, - die_off(dw, mem), el->el_name, el->el_number); + debug(3, "die %ju: enum %ju: created %s = %d\n", + (uintmax_t)off, (uintmax_t)die_off(dw, mem), + el->el_name, el->el_number); *elastp = el; elastp = &el->el_next; @@ -951,7 +961,7 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st tdp->t_type = (die_isdecl(dw, str) ? FORWARD : type); - debug(3, "die %llu: creating %s %s\n", off, + debug(3, "die %ju: creating %s %s\n", (uintmax_t)off, (tdp->t_type == FORWARD ? "forward decl" : typename), tdesc_name(tdp)); @@ -985,7 +995,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st continue; } - debug(3, "die %llu: mem %llu: creating member\n", off, memoff); + debug(3, "die %ju: mem %ju: creating member\n", + (uintmax_t)off, (uintmax_t)memoff); ml = xcalloc(sizeof (mlist_t)); @@ -1005,8 +1016,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st if (die_mem_offset(dw, mem, DW_AT_data_member_location, &mloff, 0)) { - debug(3, "die %llu: got mloff %llx\n", off, - (u_longlong_t)mloff); + debug(3, "die %ju: got mloff 0x%jx\n", (uintmax_t)off, + (uintmax_t)mloff); ml->ml_offset = mloff * 8; } @@ -1042,8 +1053,9 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st #endif } - debug(3, "die %llu: mem %llu: created \"%s\" (off %u sz %u)\n", - off, memoff, ml->ml_name, ml->ml_offset, ml->ml_size); + debug(3, "die %ju: mem %ju: created \"%s\" (off %u sz %u)\n", + (uintmax_t)off, (uintmax_t)memoff, ml->ml_name, + ml->ml_offset, ml->ml_size); *mlastp = ml; mlastp = &ml->ml_next; @@ -1091,7 +1103,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st char *new = xmalloc(newsz); (void) snprintf(new, newsz, "orphan %s", old); - debug(3, "die %llu: worked around %s %s\n", off, typename, old); + debug(3, "die %ju: worked around %s %s\n", (uintmax_t)off, + typename, old); if (tdp->t_name != NULL) free(tdp->t_name); @@ -1234,7 +1247,8 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Di fndef_t *fn; int i; - debug(3, "die %llu <%llx>: creating function pointer\n", off, off); + debug(3, "die %ju <0x%jx>: creating function pointer\n", + (uintmax_t)off, (uintmax_t)off); /* * We'll begin by processing any type definition nodes that may be @@ -1282,8 +1296,8 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Di } if (fn->fn_nargs != 0) { - debug(3, "die %llu: adding %d argument%s\n", off, fn->fn_nargs, - (fn->fn_nargs > 1 ? "s" : "")); + debug(3, "die %ju: adding %d argument%s\n", (uintmax_t)off, + fn->fn_nargs, (fn->fn_nargs > 1 ? "s" : "")); fn->fn_args = xcalloc(sizeof (tdesc_t *) * fn->fn_nargs); for (i = 0, arg = die_child(dw, die); @@ -1423,7 +1437,8 @@ die_base_type2enc(dwarf_t *dw, Dwarf_Off map++; } - terminate("die %llu: unrecognized real type size %u\n", off, sz); + terminate("die %ju: unrecognized real type size %ju\n", + (uintmax_t)off, (uintmax_t)sz); /*NOTREACHED*/ return (0); } @@ -1471,8 +1486,8 @@ die_base_from_dwarf(dwarf_t *dw, Dwarf_D intr->intr_fformat = die_base_type2enc(dw, off, enc, sz); break; default: - terminate("die %llu: unknown base type encoding 0x%llx\n", - off, enc); + terminate("die %ju: unknown base type encoding 0x%jx\n", + (uintmax_t)off, (uintmax_t)enc); } return (intr); @@ -1485,7 +1500,7 @@ die_base_create(dwarf_t *dw, Dwarf_Die b intr_t *intr; char *new; - debug(3, "die %llu: creating base type\n", off); + debug(3, "die %ju: creating base type\n", (uintmax_t)off); /* * The compilers have their own clever (internally inconsistent) ideas @@ -1506,13 +1521,13 @@ die_base_create(dwarf_t *dw, Dwarf_Die b } if (tdp->t_name == NULL) - terminate("die %llu: base type without name\n", off); + terminate("die %ju: base type without name\n", (uintmax_t)off); /* XXX make a name parser for float too */ if ((intr = die_base_name_parse(tdp->t_name, &new)) != NULL) { /* Found it. We'll use the parsed version */ - debug(3, "die %llu: name \"%s\" remapped to \"%s\"\n", off, - tdesc_name(tdp), new); + debug(3, "die %ju: name \"%s\" remapped to \"%s\"\n", + (uintmax_t)off, tdesc_name(tdp), new); free(tdp->t_name); tdp->t_name = new; @@ -1521,8 +1536,8 @@ die_base_create(dwarf_t *dw, Dwarf_Die b * We didn't recognize the type, so we'll create an intr_t * based on the DWARF data. */ - debug(3, "die %llu: using dwarf data for base \"%s\"\n", off, - tdesc_name(tdp)); + debug(3, "die %ju: using dwarf data for base \"%s\"\n", + (uintmax_t)off, tdesc_name(tdp)); intr = die_base_from_dwarf(dw, base, off, sz); } @@ -1542,7 +1557,8 @@ die_through_create(dwarf_t *dw, Dwarf_Di { Dwarf_Attribute attr; - debug(3, "die %llu <%llx>: creating %s type %d\n", off, off, typename, type); + debug(3, "die %ju <0x%jx>: creating %s type %d\n", (uintmax_t)off, + (uintmax_t)off, typename, type); tdp->t_type = type; @@ -1606,7 +1622,8 @@ die_function_create(dwarf_t *dw, Dwarf_D iidesc_t *ii; char *name; - debug(3, "die %llu <%llx>: creating function definition\n", off, off); + debug(3, "die %ju <0x%jx>: creating function definition\n", + (uintmax_t)off, (uintmax_t)off); /* * We'll begin by processing any type definition nodes that may be @@ -1635,7 +1652,7 @@ die_function_create(dwarf_t *dw, Dwarf_D if (ii->ii_type == II_SFUN) ii->ii_owner = xstrdup(dw->dw_cuname); - debug(3, "die %llu: function %s is %s\n", off, ii->ii_name, + debug(3, "die %ju: function %s is %s\n", (uintmax_t)off, ii->ii_name, (ii->ii_type == II_GFUN ? "global" : "static")); if (die_attr(dw, die, DW_AT_type, 0) != NULL) @@ -1647,15 +1664,15 @@ die_function_create(dwarf_t *dw, Dwarf_D arg = die_sibling(dw, arg)) { char *name1; - debug(3, "die %llu: looking at sub member at %llu\n", - off, die_off(dw, die)); + debug(3, "die %ju: looking at sub member at %ju\n", + (uintmax_t)off, (uintmax_t)die_off(dw, die)); if (die_tag(dw, arg) != DW_TAG_formal_parameter) continue; if ((name1 = die_name(dw, arg)) == NULL) { - terminate("die %llu: func arg %d has no name\n", - off, ii->ii_nargs + 1); + terminate("die %ju: func arg %d has no name\n", + (uintptr_t)off, ii->ii_nargs + 1); } if (strcmp(name1, "...") == 0) { @@ -1670,8 +1687,8 @@ die_function_create(dwarf_t *dw, Dwarf_D if (ii->ii_nargs > 0) { int i; - debug(3, "die %llu: function has %d argument%s\n", off, - ii->ii_nargs, (ii->ii_nargs == 1 ? "" : "s")); + debug(3, "die %ju: function has %d argument%s\n", + (uintptr_t)off, ii->ii_nargs, ii->ii_nargs == 1 ? "" : "s"); ii->ii_args = xcalloc(sizeof (tdesc_t) * ii->ii_nargs); @@ -1696,7 +1713,7 @@ die_variable_create(dwarf_t *dw, Dwarf_D iidesc_t *ii; char *name; - debug(3, "die %llu: creating object definition\n", off); + debug(3, "die %ju: creating object definition\n", (uintptr_t)off); if (die_isdecl(dw, die) || (name = die_name(dw, die)) == NULL) return; /* skip prototypes and nameless objects */ @@ -1793,17 +1810,19 @@ die_create_one(dwarf_t *dw, Dwarf_Die di Dwarf_Half tag; tdesc_t *tdp; - debug(3, "die %llu <%llx>: create_one\n", off, off); + debug(3, "die %ju <0x%jx>: create_one\n", (uintptr_t)off, + (uintptr_t)off); if (off > dw->dw_maxoff) { - terminate("illegal die offset %llu (max %llu)\n", off, + terminate("illegal die offset %ju (max %ju)\n", (uintptr_t)off, dw->dw_maxoff); } tag = die_tag(dw, die); if ((dc = die_tag2ctor(tag)) == NULL) { - debug(2, "die %llu: ignoring tag type %x\n", off, tag); + debug(2, "die %ju: ignoring tag type %x\n", (uintptr_t)off, + tag); return; } @@ -1950,7 +1969,8 @@ should_have_dwarf(Elf *elf) int dw_read(tdata_t *td, Elf *elf, char *filename __unused) { - Dwarf_Unsigned abboff, hdrlen, nxthdr; + Dwarf_Unsigned hdrlen, nxthdr; + Dwarf_Off abboff; Dwarf_Half vers, addrsz, offsz; Dwarf_Die cu = 0; Dwarf_Die child = 0; @@ -1999,6 +2019,7 @@ dw_read(tdata_t *td, Elf *elf, char *fil } if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, +/*###2022 [cc] error: passing argument 4 of 'dwarf_next_cu_header_b' from incompatible pointer type [-Werror]%%%*/ &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); @@ -2008,7 +2029,7 @@ dw_read(tdata_t *td, Elf *elf, char *fil if ((child = die_child(&dw, cu)) == NULL) { Dwarf_Unsigned lang; if (die_unsigned(&dw, cu, DW_AT_language, &lang, 0)) { - debug(1, "DWARF language: %u\n", lang); + debug(1, "DWARF language: %ju\n", (uintptr_t)lang); /* * Assembly languages are typically that. * They have some dwarf info, but not what @@ -2053,6 +2074,7 @@ dw_read(tdata_t *td, Elf *elf, char *fil die_create(&dw, child); if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, +/*###2076 [cc] error: passing argument 4 of 'dwarf_next_cu_header_b' from incompatible pointer type [-Werror]%%%*/ &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_NO_ENTRY) terminate("multiple compilation units not supported\n"); Index: src/external/cddl/osnet/dist/tools/ctf/cvt/st_parse.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/st_parse.c:1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/st_parse.c:1.5 --- src/external/cddl/osnet/dist/tools/ctf/cvt/st_parse.c:1.4 Sun Mar 9 13:04:00 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/st_parse.c Sat Feb 7 15:30:03 2015 @@ -80,7 +80,7 @@ static char *arraydef(char *cp, tdesc_t int debug_parse = DEBUG_PARSE; /*PRINTFLIKE3*/ -static void +static void __printflike(3, 4) parse_debug(int level, char *cp, const char *fmt, ...) { va_list ap; @@ -95,7 +95,7 @@ parse_debug(int level, char *cp, const c for (i = 0; i < 30; i++) { if (cp[i] == '\0') break; - if (!iscntrl(cp[i])) + if (!iscntrl((unsigned char)cp[i])) tmp[i] = cp[i]; } tmp[i] = '\0'; @@ -482,7 +482,7 @@ whitesp(char *cp) { char c; - for (c = *cp++; isspace(c); c = *cp++) + for (c = *cp++; isspace((unsigned char)c); c = *cp++) ; --cp; return (cp); @@ -498,8 +498,8 @@ name(char *cp, char **w) c = *cp++; if (c == ':') *w = NULL; - else if (isalpha(c) || strchr("_.$#", c)) { - for (c = *cp++; isalnum(c) || strchr(" _.$#", c); c = *cp++) + else if (isalpha((unsigned char)c) || strchr("_.$#", c)) { + for (c = *cp++; isalnum((unsigned char)c) || strchr(" _.$#", c); c = *cp++) ; if (c != ':') reset(); @@ -540,7 +540,7 @@ id(char *cp, int *h) if (*cp++ != ')') expected("id", ")", cp - 1); *h = MAKETYPEID(n1, n2); - } else if (isdigit(*cp)) { /* gcc style */ + } else if (isdigit((unsigned char)*cp)) { /* gcc style */ cp = number(cp, &n1); *h = n1; } else { @@ -805,7 +805,7 @@ intrinsic(char *cp, tdesc_t **rtdp) case 'R': intr->intr_type = INTR_REAL; - for (fmt = 0, i = 0; isdigit(*(cp + i)); i++) + for (fmt = 0, i = 0; isdigit((unsigned char)*(cp + i)); i++) fmt = fmt * 10 + (*(cp + i) - '0'); if (fmt < 1 || fmt > CTF_FP_MAX) Index: src/external/cddl/osnet/dist/tools/ctf/cvt/stabs.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/stabs.c:1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/stabs.c:1.5 --- src/external/cddl/osnet/dist/tools/ctf/cvt/stabs.c:1.4 Sun Mar 9 13:04:00 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/stabs.c Sat Feb 7 15:30:03 2015 @@ -190,7 +190,7 @@ stabs_read(tdata_t *td, Elf *elf, char * char *curfile = NULL; char *str; char *fstr = NULL, *ofstr = NULL; - int stabidx, stabstridx; + int stabidx, stabstridx = 0; int nstabs, rc, i; int scope = 0; Index: src/external/cddl/osnet/dist/tools/ctf/cvt/util.c diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/util.c:1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/util.c:1.5 --- src/external/cddl/osnet/dist/tools/ctf/cvt/util.c:1.4 Sun Mar 9 13:04:00 2014 +++ src/external/cddl/osnet/dist/tools/ctf/cvt/util.c Sat Feb 7 15:30:03 2015 @@ -79,14 +79,14 @@ findelfsecidx(Elf *elf, const char *file if (gelf_getshdr(scn, &shdr) == NULL) { elfterminate(file, - "Couldn't read header for section %d", + "Couldn't read header for section %zu", elf_ndxscn(scn)); } if ((name = elf_strptr(elf, ehdr.e_shstrndx, (size_t)shdr.sh_name)) == NULL) { elfterminate(file, - "Couldn't get name for section %d", + "Couldn't get name for section %zu", elf_ndxscn(scn)); } Index: src/external/cddl/osnet/lib/libdtrace/Makefile diff -u src/external/cddl/osnet/lib/libdtrace/Makefile:1.9 src/external/cddl/osnet/lib/libdtrace/Makefile:1.10 --- src/external/cddl/osnet/lib/libdtrace/Makefile:1.9 Sun Mar 16 02:51:43 2014 +++ src/external/cddl/osnet/lib/libdtrace/Makefile Sat Feb 7 15:30:03 2015 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.9 2014/03/16 06:51:43 ozaki-r Exp $ +# $NetBSD: Makefile,v 1.10 2015/02/07 20:30:03 christos Exp $ # $FreeBSD: src/cddl/lib/libdtrace/Makefile,v 1.2.2.1 2009/08/03 08:13:06 kensmith Exp $ +WARNS=1 .include <bsd.own.mk> .include "../../Makefile.inc" Index: src/external/cddl/osnet/sys/sys/sysmacros.h diff -u src/external/cddl/osnet/sys/sys/sysmacros.h:1.4 src/external/cddl/osnet/sys/sys/sysmacros.h:1.5 --- src/external/cddl/osnet/sys/sys/sysmacros.h:1.4 Tue Mar 2 16:08:36 2010 +++ src/external/cddl/osnet/sys/sys/sysmacros.h Sat Feb 7 15:30:04 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sysmacros.h,v 1.4 2010/03/02 21:08:36 darran Exp $ */ +/* $NetBSD: sysmacros.h,v 1.5 2015/02/07 20:30:04 christos Exp $ */ /* * CDDL HEADER START @@ -407,19 +407,19 @@ highbit(ulong_t i) h += 32; i >>= 32; } #endif - if (i & 0xffff0000) { + if (i & 0xffff0000ul) { h += 16; i >>= 16; } - if (i & 0xff00) { + if (i & 0xff00ul) { h += 8; i >>= 8; } - if (i & 0xf0) { + if (i & 0xf0ul) { h += 4; i >>= 4; } - if (i & 0xc) { + if (i & 0xcul) { h += 2; i >>= 2; } - if (i & 0x2) { + if (i & 0x2ul) { h += 1; } return (h);