diff options
author | John Levon <john.levon@joyent.com> | 2019-05-15 11:39:37 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2019-05-15 11:39:49 +0000 |
commit | 6853053741569b9547e774ed1593c3a260801c7f (patch) | |
tree | 8d5b1ae81a9005a0bd1a63ec7926f56f546cea98 /usr/src | |
parent | 6bb4da7d9bf3229c392786cff96466c702f9f70b (diff) | |
download | illumos-joyent-6853053741569b9547e774ed1593c3a260801c7f.tar.gz |
OS-7768 illumos-joyent needs smatch fixes
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>
Diffstat (limited to 'usr/src')
50 files changed, 215 insertions, 111 deletions
diff --git a/usr/src/cmd/adbgen/common/adbsub.c b/usr/src/cmd/adbgen/common/adbsub.c index d9b7a37273..773a215ae8 100644 --- a/usr/src/cmd/adbgen/common/adbsub.c +++ b/usr/src/cmd/adbgen/common/adbsub.c @@ -19,7 +19,6 @@ * * CDDL HEADER END */ -#pragma ident "%Z%%M% %I% %E% SMI" /* * Copyright (c) 1983-1998 by Sun Microsystems, Inc. @@ -27,6 +26,10 @@ */ /* + * Copyright 2019 Joyent, Inc. + */ + +/* * Subroutines to be called by adbgen2.c, the C program generated * by adbgen1.c. */ @@ -155,9 +158,8 @@ do_fmt(char *acp) case 'S': case 'i': if (warnings) { - fprintf(stderr, - "Unknown format size \"%s\", assuming zero\n", - acp); + fprintf(stderr, "Unknown format size \"%s\", " + "assuming zero\n", acp); warns++; } width = 0; @@ -167,7 +169,7 @@ do_fmt(char *acp) exit(1); } for (i = 0; i < rcount; i++) { - putchar(*cp); + (void) putchar(*cp); } cp++; sum += width * rcount; @@ -186,8 +188,8 @@ format(char *name, size_t size, char *fmt) fs = do_fmt(fmt); if (fs != size && warnings) { fprintf(stderr, - "warning: \"%s\" size is %ld, \"%s\" width is %d\n", - name, size, fmt, fs); + "warning: \"%s\" size is %ld, \"%s\" width is %d\n", + name, size, fmt, fs); warns++; } last_off += fs; diff --git a/usr/src/cmd/bhyve/Makefile b/usr/src/cmd/bhyve/Makefile index 0ad066e6d4..f8c5ffba8d 100644 --- a/usr/src/cmd/bhyve/Makefile +++ b/usr/src/cmd/bhyve/Makefile @@ -11,7 +11,7 @@ # # Copyright 2014 Pluribus Networks Inc. -# Copyright (c) 2018, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # PROG = bhyve @@ -120,6 +120,8 @@ CPPFLAGS += -DNO_OPENSSL pci_nvme.o := CERRWARN += -_gcc=-Wno-pointer-sign +SMOFF += all_func_returns,leaks,no_if_block + # Force c99 for everything CSTD= $(CSTD_GNU99) C99MODE= -xc99=%all diff --git a/usr/src/cmd/bhyve/test/Makefile.com b/usr/src/cmd/bhyve/test/Makefile.com index 3c719bcea7..3367ae50ea 100644 --- a/usr/src/cmd/bhyve/test/Makefile.com +++ b/usr/src/cmd/bhyve/test/Makefile.com @@ -10,7 +10,7 @@ # # -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # include $(SRC)/Makefile.master @@ -41,6 +41,8 @@ CPPFLAGS = -I$(SRC)/cmd/bhyve \ -DWITHOUT_CAPSICUM CPPFLAGS += -I$(COMPAT)/freebsd/amd64 -I$(CONTRIB)/freebsd/amd64 +SMOFF += all_func_returns + CLEANFILES += $(EXETESTS) CLOBBERFILES += $(ROOTTESTS) diff --git a/usr/src/cmd/bhyve/uart_emul.c b/usr/src/cmd/bhyve/uart_emul.c index 1027d0b0f6..79d8c64c7a 100644 --- a/usr/src/cmd/bhyve/uart_emul.c +++ b/usr/src/cmd/bhyve/uart_emul.c @@ -404,7 +404,11 @@ uart_reset(struct uart_softc *sc) divisor = DEFAULT_RCLK / DEFAULT_BAUD / 16; sc->dll = divisor; +#ifndef __FreeBSD__ + sc->dlh = 0; +#else sc->dlh = divisor >> 16; +#endif sc->msr = modem_status(sc->mcr); rxfifo_reset(sc, 1); /* no fifo until enabled by software */ diff --git a/usr/src/cmd/bhyve/usb_mouse.c b/usr/src/cmd/bhyve/usb_mouse.c index e613012071..921fce5db9 100644 --- a/usr/src/cmd/bhyve/usb_mouse.c +++ b/usr/src/cmd/bhyve/usb_mouse.c @@ -663,11 +663,18 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer) } done: +/* UT_WRITE is 0, so this is condition is never true. */ +#ifdef __FreeBSD__ if (xfer->ureq && (xfer->ureq->bmRequestType & UT_WRITE) && (err == USB_ERR_NORMAL_COMPLETION) && (data != NULL)) data->blen = 0; else if (eshort) err = USB_ERR_SHORT_XFER; +#else + if (eshort) + err = USB_ERR_SHORT_XFER; +#endif + DPRINTF(("umouse request error code %d (0=ok), blen %u txlen %u\r\n", err, (data ? data->blen : 0), (data ? data->bdone : 0))); diff --git a/usr/src/cmd/bhyvectl/Makefile b/usr/src/cmd/bhyvectl/Makefile index 11b16ca4df..af961ada45 100644 --- a/usr/src/cmd/bhyvectl/Makefile +++ b/usr/src/cmd/bhyvectl/Makefile @@ -11,7 +11,7 @@ # # Copyright 2013 Pluribus Networks Inc. -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # PROG = bhyvectl @@ -37,6 +37,9 @@ LDLIBS += -lvmmapi CERRWARN += -_gcc=-Wno-uninitialized +# main() is too hairy for smatch +bhyvectl.o := SMATCH=off + all: $(PROG) $(PROG): $(OBJS) diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c b/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c index 2bcf7f233f..374768efc5 100644 --- a/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c +++ b/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c @@ -771,7 +771,7 @@ bhyve_vtol_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) if (vmm_vtol(bd->bd_vmm, bd->bd_curcpu, segreg, addr, &laddr) != 0) { if (errno == EFAULT) - set_errno(EMDB_NOMAP); + (void) set_errno(EMDB_NOMAP); return (DCMD_ERR); } @@ -1231,13 +1231,13 @@ bhyve_status(mdb_tgt_t *tgt, mdb_tgt_status_t *tsp) switch (vmm_vcpu_isa(bd->bd_vmm, bd->bd_curcpu)) { case VMM_ISA_16: - mdb_dis_select("ia16"); + (void) mdb_dis_select("ia16"); break; case VMM_ISA_32: - mdb_dis_select("ia32"); + (void) mdb_dis_select("ia32"); break; case VMM_ISA_64: - mdb_dis_select("amd64"); + (void) mdb_dis_select("amd64"); break; default: break; @@ -1301,7 +1301,7 @@ bhyve_cont(mdb_tgt_t *tgt, mdb_tgt_status_t *tsp) } tsp->st_state = MDB_TGT_RUNNING; - pause(); + (void) pause(); (void) mdb_signal_sethandler(SIGINT, intf, intd); (void) mdb_tgt_status(tgt, tsp); @@ -1444,7 +1444,7 @@ mdb_bhyve_tgt_create(mdb_tgt_t *tgt, int argc, const char *argv[]) } bd = mdb_zalloc(sizeof (bhyve_data_t) + strlen(argv[0]) + 1, UM_SLEEP); - strcpy(bd->bd_name, argv[0]); + (void) strcpy(bd->bd_name, argv[0]); bd->bd_vmm = vmm; bd->bd_curcpu = 0; bd->bd_defseg = VMM_DESC_DS; diff --git a/usr/src/cmd/svc/configd/Makefile b/usr/src/cmd/svc/configd/Makefile index 9617a53f79..4d74800a7f 100644 --- a/usr/src/cmd/svc/configd/Makefile +++ b/usr/src/cmd/svc/configd/Makefile @@ -24,6 +24,8 @@ # # Copyright 2015 RackTop Systems. # +# Copyright 2019 Joyent, Inc. +# MYPROG = svc.configd MYOBJS = \ @@ -60,6 +62,11 @@ CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-uninitialized + +# Despite the source being the same as upstream, smatch gives us a bizarre false +# positive here. +SMOFF += free + MYLDLIBS = -lumem -luutil LDLIBS += -lsecdb -lbsm $(MYLDLIBS) LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2 -erroff=E_NAME_DEF_NOT_USED2 diff --git a/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile b/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile index 377c91df68..a53111c4fb 100644 --- a/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile +++ b/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile @@ -22,6 +22,8 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2019 Joyent, Inc. +# LIBRARY = sysevent_conf_mod @@ -32,11 +34,14 @@ CPPFLAGS += -I ../../daemons/syseventconfd CERRWARN += -_gcc=-Wno-uninitialized +# strange smatch false positive +SMOFF += allocating_enough_data + .KEEP_STATE: all: $(DYNLIB) -install: all \ +install: all \ $(ROOTLIBSYSEVENTDIR) \ $(ROOTLIBDIR) \ $(ROOTLIBS) diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index 993d98ea12..40dfe1cab7 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2019 Joyent, Inc. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -1112,7 +1112,7 @@ destroy_callback(zfs_handle_t *zhp, void *data) while ((err = zfs_destroy_snaps_nvl(g_zfs, cbp->cb_batchedsnaps, B_FALSE)) != 0) { if (cbp->cb_wait && libzfs_errno(g_zfs) == EZFS_BUSY) { - nanosleep(&ts, NULL); + (void) nanosleep(&ts, NULL); continue; } (void) fprintf(stderr, "%s: %s\n", diff --git a/usr/src/cmd/zoneadmd/log.c b/usr/src/cmd/zoneadmd/log.c index f08f0288ec..121c5236a7 100644 --- a/usr/src/cmd/zoneadmd/log.c +++ b/usr/src/cmd/zoneadmd/log.c @@ -463,8 +463,8 @@ logstream_init(zlog_t *zlogp) * file and reopen it during log rotation. SIGUSR1 can be used to force * a log rotation. */ - sigset(SIGHUP, logstream_sighandler); - sigset(SIGUSR1, logstream_sighandler); + (void) sigset(SIGHUP, logstream_sighandler); + (void) sigset(SIGUSR1, logstream_sighandler); } /* diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c index 498ba4ac57..9f998ba475 100644 --- a/usr/src/cmd/zoneadmd/zoneadmd.c +++ b/usr/src/cmd/zoneadmd/zoneadmd.c @@ -1101,7 +1101,7 @@ do_subproc(zlog_t *zlogp, char *cmdbuf, char **retstr, boolean_t debug) * zoneadmd' to kill this child process before exec(). On * exec(), SIGHUP and SIGUSR1 will become SIG_DFL. */ - sigset(SIGINT, SIG_DFL); + (void) sigset(SIGINT, SIG_DFL); /* * Set up a pipe for the child to log to. diff --git a/usr/src/common/smbios/smb_info.c b/usr/src/common/smbios/smb_info.c index 2c67f2964a..358b4e0ddb 100644 --- a/usr/src/common/smbios/smb_info.c +++ b/usr/src/common/smbios/smb_info.c @@ -21,7 +21,7 @@ /* * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved. - * Copyright (c) 2018, Joyent, Inc. + * Copyright 2019 Joyent, Inc. * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -698,8 +698,8 @@ smbios_info_slot_peers(smbios_hdl_t *shp, id_t id, uint_t *npeers, smbios_slot_peer_t **peerp) { const smb_struct_t *stp = smb_lookup_id(shp, id); - const smb_slot_t *slotp = (const smb_slot_t *)stp->smbst_hdr; smbios_slot_peer_t *peer; + const smb_slot_t *slotp; size_t minlen; uint_t i; @@ -709,6 +709,8 @@ smbios_info_slot_peers(smbios_hdl_t *shp, id_t id, uint_t *npeers, if (stp->smbst_hdr->smbh_type != SMB_TYPE_SLOT) return (smb_set_errno(shp, ESMB_TYPE)); + slotp = (const smb_slot_t *)stp->smbst_hdr; + if (stp->smbst_hdr->smbh_len <= offsetof(smb_slot_t, smbsl_npeers) || slotp->smbsl_npeers == 0) { *npeers = 0; diff --git a/usr/src/lib/brand/lx/librtld_db/Makefile.com b/usr/src/lib/brand/lx/librtld_db/Makefile.com index 202cc0fe7b..3f2645f157 100644 --- a/usr/src/lib/brand/lx/librtld_db/Makefile.com +++ b/usr/src/lib/brand/lx/librtld_db/Makefile.com @@ -23,8 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# +# Copyright 2019 Joyent, Inc. LIBRARY = lx_librtld_db.a VERS = .1 @@ -59,6 +58,9 @@ CPPFLAGS += -D_REENTRANT -I../ -I$(UTSBASE)/common/brand/lx \ -I$(SRC)/cmd/sgs/include \ -I$(SRC)/cmd/sgs/include/$(MACH) +# not linted +SMATCH=off + ROOTLIBDIR = $(ROOT)/usr/lib/brand/lx ROOTLIBDIR64 = $(ROOT)/usr/lib/brand/lx/$(MACH64) diff --git a/usr/src/lib/brand/lx/lx_brand/Makefile.com b/usr/src/lib/brand/lx/lx_brand/Makefile.com index bb9ce6ed93..01fe63d70e 100644 --- a/usr/src/lib/brand/lx/lx_brand/Makefile.com +++ b/usr/src/lib/brand/lx/lx_brand/Makefile.com @@ -21,7 +21,7 @@ # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# Copyright (c) 2019, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # LX_CMN = $(SRC)/common/brand/lx @@ -77,6 +77,9 @@ CPPFLAGS += -D_REENTRANT -I. -I../ -I$(UTSBASE)/common/brand/lx -I$(LX_CMN) ASFLAGS = -P $(ASFLAGS_$(CURTYPE)) -D_ASM -I../ \ -I$(UTSBASE)/common/brand/lx +# not linted +SMATCH=off + C99MODE= -xc99=%all C99LMODE= -Xc99=%all diff --git a/usr/src/lib/brand/lx/lx_init/Makefile b/usr/src/lib/brand/lx/lx_init/Makefile index e887e893f5..7ce36ba51d 100644 --- a/usr/src/lib/brand/lx/lx_init/Makefile +++ b/usr/src/lib/brand/lx/lx_init/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # PROG = lxinit @@ -47,6 +47,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(UTSBASE)/common/brand/lx LDLIBS += -lzonecfg -lipadm -lsocket -linetutil -lnsl -lcustr -ldhcpagent +# not linted +SMATCH=off + .KEEP_STATE: install: all $(ROOTPROG) diff --git a/usr/src/lib/brand/lx/lx_lockd/Makefile b/usr/src/lib/brand/lx/lx_lockd/Makefile index debefdf815..c1ff1b2d62 100644 --- a/usr/src/lib/brand/lx/lx_lockd/Makefile +++ b/usr/src/lib/brand/lx/lx_lockd/Makefile @@ -9,7 +9,7 @@ # http://www.illumos.org/license/CDDL. # -# Copyright 2017 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # PROG = lx_lockd @@ -37,6 +37,9 @@ CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-uninitialized CERRWARN += -_gcc=-Wno-unused-function +# not linted +SMATCH=off + .KEEP_STATE: install: all $(ROOTPROG) diff --git a/usr/src/lib/brand/lx/lx_support/Makefile b/usr/src/lib/brand/lx/lx_support/Makefile index e7c958e13a..094f63d16a 100644 --- a/usr/src/lib/brand/lx/lx_support/Makefile +++ b/usr/src/lib/brand/lx/lx_support/Makefile @@ -22,6 +22,7 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2019 Joyent, Inc. PROG = lx_support PROGS = $(PROG) @@ -42,6 +43,8 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(UTSBASE)/common/brand/lx LDLIBS += -lzonecfg +SMOFF += signed + .KEEP_STATE: install: all $(ROOTPROGS) diff --git a/usr/src/lib/brand/lx/lx_vdso/common/vdso_main.c b/usr/src/lib/brand/lx/lx_vdso/common/vdso_main.c index f7d86e3da4..40528a152b 100644 --- a/usr/src/lib/brand/lx/lx_vdso/common/vdso_main.c +++ b/usr/src/lib/brand/lx/lx_vdso/common/vdso_main.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2016 Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ #include <cp_defs.h> @@ -101,7 +101,7 @@ __vdso_gettimeofday(timespec_t *tp, struct lx_timezone *tz) return (__vdso_sys_gettimeofday(tp, tz)); } - __cp_clock_gettime_realtime(cp, tp); + (void) __cp_clock_gettime_realtime(cp, tp); tp->tv_nsec /= 1000; } return (0); @@ -117,7 +117,7 @@ __vdso_time(time_t *tp) return (__vdso_sys_time(tp)); } - __cp_clock_gettime_realtime(cp, &ts); + (void) __cp_clock_gettime_realtime(cp, &ts); if (tp != NULL) { *tp = ts.tv_sec; } diff --git a/usr/src/lib/fm/libfmd_adm/common/fmd_adm.c b/usr/src/lib/fm/libfmd_adm/common/fmd_adm.c index a637542c62..33c68f4a05 100644 --- a/usr/src/lib/fm/libfmd_adm/common/fmd_adm.c +++ b/usr/src/lib/fm/libfmd_adm/common/fmd_adm.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ + #include <strings.h> #include <stdlib.h> #include <netdir.h> @@ -1027,7 +1031,7 @@ fmd_adm_xprt_iter(fmd_adm_t *ap, fmd_adm_xprt_f *func, void *arg) } for (i = 0; i < rxl.rxl_len; i++) - func(rxl.rxl_buf.rxl_buf_val[i], arg); + (void) func(rxl.rxl_buf.rxl_buf_val[i], arg); xdr_free(xdr_fmd_rpc_xprtlist, (char *)&rxl); return (0); diff --git a/usr/src/lib/libdemangle/common/rust.c b/usr/src/lib/libdemangle/common/rust.c index f99fe79a10..def4056d74 100644 --- a/usr/src/lib/libdemangle/common/rust.c +++ b/usr/src/lib/libdemangle/common/rust.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2019, Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ #include <errno.h> @@ -239,7 +239,7 @@ rustdem_parse_name_segment(rustdem_state_t *st, strview_t *svp, boolean_t first) rem = sv_remaining(&sv); - if (rem < len || len > SIZE_MAX) { + if (rem < len || len >= SIZE_MAX) { st->rds_error = EINVAL; return (B_FALSE); } diff --git a/usr/src/lib/libpctx/Makefile.com b/usr/src/lib/libpctx/Makefile.com index c9d50e434c..2b9c8e4355 100644 --- a/usr/src/lib/libpctx/Makefile.com +++ b/usr/src/lib/libpctx/Makefile.com @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" +# Copyright 2019 Joyent, Inc. # LIBRARY = libpctx.a @@ -40,7 +40,10 @@ LDLIBS += -lproc -lc SRCDIR = ../common CFLAGS += $(CCVERBOSE) -CPPFLAGS += -D_REENTRANT -I$(SRCDIR) +CPPFLAGS += -D_REENTRANT -I$(SRCDIR) + +# false positive: pctx_run() error: dereferencing freed memory 'pctx' +SMOFF += free .KEEP_STATE: diff --git a/usr/src/lib/libresolv2_joy/Makefile.com b/usr/src/lib/libresolv2_joy/Makefile.com index bbabcbcede..59eda28fed 100644 --- a/usr/src/lib/libresolv2_joy/Makefile.com +++ b/usr/src/lib/libresolv2_joy/Makefile.com @@ -22,7 +22,7 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# +# Copyright 2019 Joyent, Inc. LIBRARY= libresolv_joy.a VERS= .2 @@ -32,16 +32,16 @@ BSDOBJS= daemon.o putenv.o strcasecmp.o strsep.o \ gettimeofday.o setenv.o strerror.o utimes.o \ mktemp.o setitimer.o strpbrk.o writev.o -DSTOBJS= dst_api.o support.o hmac_link.o +DSTOBJS= dst_api.o support.o hmac_link.o -# inet_addr, inet_pton, inet_ntop, and inet_ntoa removed due to overlap with +# inet_addr, inet_pton, inet_ntop, and inet_ntoa removed due to overlap with # libnsl INETOBJS= inet_net_pton.o inet_neta.o inet_lnaof.o \ inet_netof.o nsap_addr.o inet_makeaddr.o \ inet_network.o inet_net_ntop.o inet_cidr_ntop.o \ inet_cidr_pton.o inet_data.o -# build only the IRS objects that the ISC libbind's make would +# build only the IRS objects that the ISC libbind's make would IRSTHROBJS= gethostent_r.o getnetent_r.o getnetgrent_r.o \ getprotoent_r.o getservent_r.o IRSOBJS= ${IRSTHROBJS} \ @@ -108,10 +108,13 @@ LOCFLAGS += $(CRYPTFLAGS) LOCFLAGS += -D_SYS_STREAM_H -D_REENTRANT -DSVR4 -DSUNW_OPTIONS \ $(SOLCOMPAT) -I../include -I../../common/inc -CPPFLAGS += $(LOCFLAGS) +CPPFLAGS += $(LOCFLAGS) CERRWARN += -_gcc=-Wno-implicit-function-declaration +# not linted +SMATCH=off + DYNFLAGS += $(ZNODELETE) LDLIBS += -lsocket -lnsl -lc -lmd diff --git a/usr/src/lib/libvmm/libvmm.c b/usr/src/lib/libvmm/libvmm.c index 8c8e32c9f3..dc552a8de0 100644 --- a/usr/src/lib/libvmm/libvmm.c +++ b/usr/src/lib/libvmm/libvmm.c @@ -228,13 +228,16 @@ vmm_unmap(vmm_t *vmm) while (!list_is_empty(&vmm->vmm_memlist)) { vmm_memseg_t *ms = list_remove_head(&vmm->vmm_memlist); - if (vmm->vmm_mem != MAP_FAILED) - munmap(vmm->vmm_mem + ms->vms_gpa, ms->vms_maplen); + if (vmm->vmm_mem != MAP_FAILED) { + (void) munmap(vmm->vmm_mem + ms->vms_gpa, + ms->vms_maplen); + } + free(ms); } if (vmm->vmm_mem != MAP_FAILED) - munmap(vmm->vmm_mem, vmm->vmm_memsize); + (void) munmap(vmm->vmm_mem, vmm->vmm_memsize); vmm->vmm_mem = MAP_FAILED; vmm->vmm_memsize = 0; diff --git a/usr/src/lib/libvmmapi/Makefile.com b/usr/src/lib/libvmmapi/Makefile.com index f975b1775f..34240f4331 100644 --- a/usr/src/lib/libvmmapi/Makefile.com +++ b/usr/src/lib/libvmmapi/Makefile.com @@ -12,6 +12,7 @@ # # Copyright 2013 Pluribus Networks Inc. # +# Copyright 2019 Joyent, Inc. LIBRARY = libvmmapi.a VERS = .1 @@ -31,6 +32,9 @@ LIBS = $(DYNLIB) $(LINTLIB) CPPFLAGS = -I$(COMPAT)/freebsd -I$(CONTRIB)/freebsd \ $(CPPFLAGS.master) -I$(SRC)/uts/i86pc +# not linted +SMATCH=off + $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) LDLIBS += -lc diff --git a/usr/src/lib/libvnd/Makefile.com b/usr/src/lib/libvnd/Makefile.com index 3c6896de11..c567a9b942 100644 --- a/usr/src/lib/libvnd/Makefile.com +++ b/usr/src/lib/libvnd/Makefile.com @@ -10,7 +10,7 @@ # # -# Copyright (c) 2014 Joyent, Inc. All rights reserved. +# Copyright 2019 Joyent, Inc. # include ../../Makefile.lib @@ -25,6 +25,9 @@ LIBS = $(DYNLIB) $(LINTLIB) LDLIBS += -lc CPPFLAGS += -I../common +# false positives in vnd_create() +SMOFF += free + SRCDIR = ../common C99MODE= -xc99=%all diff --git a/usr/src/lib/libzdoor/common/zdoor.c b/usr/src/lib/libzdoor/common/zdoor.c index d04e7ccb0f..aa52458f90 100644 --- a/usr/src/lib/libzdoor/common/zdoor.c +++ b/usr/src/lib/libzdoor/common/zdoor.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2018 Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ #include <alloca.h> @@ -381,7 +381,7 @@ out: if (status != ZDOOR_OK) { zdoor_debug("zdoor_open: status not ok, stopping and cleaning"); zdoor_stop(entry); - ztree_door_remove(handle, entry); + (void) ztree_door_remove(handle, entry); zdoor_cookie_free(zdoor_cookie); } (void) pthread_mutex_unlock(&(handle->zdh_lock)); diff --git a/usr/src/lib/libzdoor/common/ztree.c b/usr/src/lib/libzdoor/common/ztree.c index 25c67f62fb..22ef0ad94f 100644 --- a/usr/src/lib/libzdoor/common/ztree.c +++ b/usr/src/lib/libzdoor/common/ztree.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2011 Joyent, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright 2019 Joyent, Inc. */ #include <search.h> @@ -114,7 +113,7 @@ dtree_entry_free(dtree_entry_t *entry) */ int ztree_zone_add(struct zdoor_handle *handle, const char *zonename, -ztree_door_visitor visitor) + ztree_door_visitor visitor) { ztree_entry_t *entry = NULL; void *ret = NULL; @@ -182,7 +181,7 @@ ztree_zone_remove(struct zdoor_handle *handle, ztree_entry_t *entry) if (handle == NULL || entry == NULL) return; - tdelete(entry, &(handle->zdh_ztree), _ztree_compare); + (void) tdelete(entry, &(handle->zdh_ztree), _ztree_compare); ztree_entry_free(entry); } @@ -196,7 +195,7 @@ ztree_zone_remove(struct zdoor_handle *handle, ztree_entry_t *entry) */ int ztree_door_add(struct zdoor_handle *handle, const char *zonename, -const char *service, zdoor_callback callback, zdoor_cookie_t *cookie) + const char *service, zdoor_callback callback, zdoor_cookie_t *cookie) { dtree_entry_t *entry = NULL; ztree_entry_t *znode = NULL; @@ -247,7 +246,7 @@ const char *service, zdoor_callback callback, zdoor_cookie_t *cookie) */ dtree_entry_t * ztree_door_find(struct zdoor_handle *handle, const char *zonename, -const char *service) + const char *service) { dtree_entry_t key = {0}; ztree_entry_t *znode = NULL; @@ -284,7 +283,7 @@ ztree_door_remove(struct zdoor_handle *handle, dtree_entry_t *entry) znode = entry->dte_parent; cookie = entry->dte_cookie; - tdelete(entry, &(znode->zte_door_tree), _dtree_compare); + (void) tdelete(entry, &(znode->zte_door_tree), _dtree_compare); dtree_entry_free(entry); znode->zte_num_doors--; diff --git a/usr/src/lib/libzonecfg/common/libzonecfg.c b/usr/src/lib/libzonecfg/common/libzonecfg.c index 3c6e8d67ed..27eb28206c 100644 --- a/usr/src/lib/libzonecfg/common/libzonecfg.c +++ b/usr/src/lib/libzonecfg/common/libzonecfg.c @@ -22,7 +22,7 @@ /* * Copyright 2014 Gary Mills * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018, Joyent, Inc. + * Copyright 2019 Joyent, Inc. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ @@ -1520,7 +1520,7 @@ zonecfg_notify_conf_change(const char *zname, char *os, char *ns) return; /* Current time since Jan 1 1970 but consumers expect NS */ - gettimeofday(&now, NULL); + (void) gettimeofday(&now, NULL); t = (now.tv_sec * NANOSEC) + (now.tv_usec * 1000); if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP) == 0 && diff --git a/usr/src/lib/varpd/libvarpd/common/libvarpd_prop.c b/usr/src/lib/varpd/libvarpd/common/libvarpd_prop.c index abe65a8c5d..f3a1492408 100644 --- a/usr/src/lib/varpd/libvarpd/common/libvarpd_prop.c +++ b/usr/src/lib/varpd/libvarpd/common/libvarpd_prop.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2015 Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ /* @@ -200,7 +200,8 @@ libvarpd_prop_info_fill_int(varpd_prop_handle_t *vph, uint_t propid) libvarpd_prop_set_prot(vph, OVERLAY_PROP_PERM_READ); libvarpd_prop_set_type(vph, OVERLAY_PROP_T_STRING); libvarpd_prop_set_nodefault(vph); - libvarpd_plugin_walk((varpd_handle_t *)infop->vprop_instance->vri_impl, + (void) libvarpd_plugin_walk( + (varpd_handle_t *)infop->vprop_instance->vri_impl, libvarpd_prop_info_fill_int_cb, vph); return (0); } diff --git a/usr/src/tools/cpcgen/cpcgen.c b/usr/src/tools/cpcgen/cpcgen.c index 2babf4f6f3..f2cbe0592c 100644 --- a/usr/src/tools/cpcgen/cpcgen.c +++ b/usr/src/tools/cpcgen/cpcgen.c @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2019, Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ /* @@ -892,7 +892,6 @@ cpcgen_manual_intel_file_before(FILE *f, cpc_map_t *map) return (B_FALSE); } - free(upper); return (B_TRUE); } diff --git a/usr/src/uts/common/fs/dev/sdev_plugin.c b/usr/src/uts/common/fs/dev/sdev_plugin.c index 6e1618dc3c..621eb3287f 100644 --- a/usr/src/uts/common/fs/dev/sdev_plugin.c +++ b/usr/src/uts/common/fs/dev/sdev_plugin.c @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2018, Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ /* @@ -611,7 +611,7 @@ sdev_plugin_register(const char *name, sdev_plugin_ops_t *ops, int *errp) * to make sure we really get to the global /dev (i.e. escape both * CRED() and ->u_rdir). */ - pn_get_buf("dev", UIO_SYSSPACE, &pn, buf, sizeof (buf)); + (void) pn_get_buf("dev", UIO_SYSSPACE, &pn, buf, sizeof (buf)); VN_HOLD(rootdir); ret = lookuppnvp(&pn, NULL, NO_FOLLOW, NULLVPP, &vp, rootdir, rootdir, kcred); diff --git a/usr/src/uts/common/io/dr_sas/dr_sas.c b/usr/src/uts/common/io/dr_sas/dr_sas.c index 02354c9b16..3f7be11abf 100644 --- a/usr/src/uts/common/io/dr_sas/dr_sas.c +++ b/usr/src/uts/common/io/dr_sas/dr_sas.c @@ -46,7 +46,7 @@ */ /* - * Copyright 2018 Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ #include <sys/types.h> @@ -1299,7 +1299,8 @@ drsas_tran_start(struct scsi_address *ap, register struct scsi_pkt *pkt) cmd->sync_cmd = DRSAS_TRUE; - instance->func_ptr-> issue_cmd_in_poll_mode(instance, cmd); + (void) instance->func_ptr-> + issue_cmd_in_poll_mode(instance, cmd); pkt->pkt_reason = CMD_CMPLT; pkt->pkt_statistics = 0; @@ -4524,6 +4525,7 @@ display_scsi_inquiry(caddr_t scsi_inq) #define MAX_SCSI_DEVICE_CODE 14 int i; char inquiry_buf[256] = {0}; + int bufsize = sizeof (inquiry_buf); int len; const char *const scsi_device_types[] = { "Direct-Access ", @@ -4544,44 +4546,44 @@ display_scsi_inquiry(caddr_t scsi_inq) len = 0; - len += snprintf(inquiry_buf + len, 265 - len, " Vendor: "); + len += snprintf(inquiry_buf + len, bufsize - len, " Vendor: "); for (i = 8; i < 16; i++) { - len += snprintf(inquiry_buf + len, 265 - len, "%c", + len += snprintf(inquiry_buf + len, bufsize - len, "%c", scsi_inq[i]); } - len += snprintf(inquiry_buf + len, 265 - len, " Model: "); + len += snprintf(inquiry_buf + len, bufsize - len, " Model: "); for (i = 16; i < 32; i++) { - len += snprintf(inquiry_buf + len, 265 - len, "%c", + len += snprintf(inquiry_buf + len, bufsize - len, "%c", scsi_inq[i]); } - len += snprintf(inquiry_buf + len, 265 - len, " Rev: "); + len += snprintf(inquiry_buf + len, bufsize - len, " Rev: "); for (i = 32; i < 36; i++) { - len += snprintf(inquiry_buf + len, 265 - len, "%c", + len += snprintf(inquiry_buf + len, bufsize - len, "%c", scsi_inq[i]); } - len += snprintf(inquiry_buf + len, 265 - len, "\n"); + len += snprintf(inquiry_buf + len, bufsize - len, "\n"); i = scsi_inq[0] & 0x1f; - len += snprintf(inquiry_buf + len, 265 - len, " Type: %s ", + len += snprintf(inquiry_buf + len, bufsize - len, " Type: %s ", i < MAX_SCSI_DEVICE_CODE ? scsi_device_types[i] : "Unknown "); - len += snprintf(inquiry_buf + len, 265 - len, + len += snprintf(inquiry_buf + len, bufsize - len, " ANSI SCSI revision: %02x", scsi_inq[2] & 0x07); if ((scsi_inq[2] & 0x07) == 1 && (scsi_inq[3] & 0x0f) == 1) { - len += snprintf(inquiry_buf + len, 265 - len, " CCS\n"); + len += snprintf(inquiry_buf + len, bufsize - len, " CCS\n"); } else { - len += snprintf(inquiry_buf + len, 265 - len, "\n"); + len += snprintf(inquiry_buf + len, bufsize - len, "\n"); } con_log(CL_ANN1, (CE_CONT, inquiry_buf)); @@ -5214,13 +5216,13 @@ drsas_parse_devname(char *devnm, int *tgt, int *lun) if (ddi_strtol(tp, NULL, 0x10, &num)) { return (DDI_FAILURE); /* Can declare this as constant */ } - *tgt = (int)num; + *tgt = (int)num; } if (lun && lp) { if (ddi_strtol(lp, NULL, 0x10, &num)) { return (DDI_FAILURE); } - *lun = (int)num; + *lun = (int)num; } return (DDI_SUCCESS); /* Success case */ } diff --git a/usr/src/uts/common/io/i40e/i40e_main.c b/usr/src/uts/common/io/i40e/i40e_main.c index 0623aee513..e3707a8342 100644 --- a/usr/src/uts/common/io/i40e/i40e_main.c +++ b/usr/src/uts/common/io/i40e/i40e_main.c @@ -2262,7 +2262,7 @@ i40e_config_def_vsi(i40e_t *i40e, i40e_hw_t *hw) i40e_error(i40e, "Unexpected L2 filter count: %u" " (expected 0)", i40e->i40e_resources.ifr_nmacfilt_used); - return (B_FALSE); + return (B_FALSE); } } diff --git a/usr/src/uts/common/io/scsi/adapters/smrt/smrt_hba.c b/usr/src/uts/common/io/scsi/adapters/smrt/smrt_hba.c index 8f082ffc9c..0eec7c2482 100644 --- a/usr/src/uts/common/io/scsi/adapters/smrt/smrt_hba.c +++ b/usr/src/uts/common/io/scsi/adapters/smrt/smrt_hba.c @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2017, Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ #include <sys/scsi/adapters/smrt/smrt.h> @@ -650,7 +650,7 @@ smrt_tran_start(struct scsi_address *sa, struct scsi_pkt *pkt) * the completion callback, so it may not be referenced again * after this call returns. */ - smrt_poll_for(smrt, smcm); + (void) smrt_poll_for(smrt, smcm); } mutex_exit(&smrt->smrt_mutex); diff --git a/usr/src/uts/i86pc/io/viona/viona.c b/usr/src/uts/i86pc/io/viona/viona.c index 4095d602f9..f9139bd381 100644 --- a/usr/src/uts/i86pc/io/viona/viona.c +++ b/usr/src/uts/i86pc/io/viona/viona.c @@ -1568,7 +1568,7 @@ viona_worker_rx(viona_vring_t *ring, viona_link_t *link) { proc_t *p = ttoproc(curthread); - thread_vsetname(curthread, "viona_rx_%p", ring); + (void) thread_vsetname(curthread, "viona_rx_%p", ring); ASSERT(MUTEX_HELD(&ring->vr_lock)); ASSERT3U(ring->vr_state, ==, VRS_RUN); @@ -1593,7 +1593,7 @@ viona_worker_tx(viona_vring_t *ring, viona_link_t *link) { proc_t *p = ttoproc(curthread); - thread_vsetname(curthread, "viona_tx_%p", ring); + (void) thread_vsetname(curthread, "viona_tx_%p", ring); ASSERT(MUTEX_HELD(&ring->vr_lock)); ASSERT3U(ring->vr_state, ==, VRS_RUN); diff --git a/usr/src/uts/i86pc/ppt/Makefile b/usr/src/uts/i86pc/ppt/Makefile index 34661bd3f3..60add02d5a 100644 --- a/usr/src/uts/i86pc/ppt/Makefile +++ b/usr/src/uts/i86pc/ppt/Makefile @@ -11,7 +11,7 @@ # # Copyright 2013 Pluribus Networks Inc. -# Copyright 2017 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # # @@ -54,6 +54,9 @@ LDFLAGS += -dy -N drv/vmm -N misc/pcie $(OBJS_DIR)/ppt.o := CERRWARN += -_gcc=-Wno-unused-variable +# needs work +SMOFF += all_func_returns + # # Default build targets. # diff --git a/usr/src/uts/i86pc/viona/Makefile b/usr/src/uts/i86pc/viona/Makefile index a1ebcd4f8b..7053d62967 100644 --- a/usr/src/uts/i86pc/viona/Makefile +++ b/usr/src/uts/i86pc/viona/Makefile @@ -11,7 +11,7 @@ # # Copyright 2013 Pluribus Networks Inc. -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # # @@ -49,6 +49,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2 LINTTAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 +# needs work +SMOFF += all_func_returns + ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) diff --git a/usr/src/uts/i86pc/vmm/Makefile b/usr/src/uts/i86pc/vmm/Makefile index 97633d9abb..72090ac159 100644 --- a/usr/src/uts/i86pc/vmm/Makefile +++ b/usr/src/uts/i86pc/vmm/Makefile @@ -11,7 +11,7 @@ # # Copyright 2013 Pluribus Networks Inc. -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # # @@ -76,6 +76,15 @@ LINTTAGS += -erroff=E_ZERO_OR_NEGATIVE_SUBSCRIPT CERRWARN += -_gcc=-Wno-empty-body +# 3rd party code +SMOFF += all_func_returns + +# needs work +$(OBJS_DIR)/vmm_sol_dev.o := SMOFF += signed_integer_overflow_check + +# a can't happen: vmx_setcap() warn: variable dereferenced before check 'pptr' +$(OBJS_DIR)/vmx.o := SMOFF += deref_check + # These sources only compile with gcc. Workaround a confluence of cruft # regarding dmake and shadow compilation by neutering the sun compiler. #amd64_CC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc diff --git a/usr/src/uts/intel/hyprlofs/Makefile b/usr/src/uts/intel/hyprlofs/Makefile index 919b045617..b921e03525 100644 --- a/usr/src/uts/intel/hyprlofs/Makefile +++ b/usr/src/uts/intel/hyprlofs/Makefile @@ -25,11 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# This makefile drives the production of the hyprlofs file system -# kernel module. -# -# intel architecture dependent -# +# Copyright 2019 Joyent, Inc. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -56,6 +52,9 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +# needs work +$(OBJS_DIR)/hyprlofs_vnops.o := SMOFF += signed + # # Default build targets. # diff --git a/usr/src/uts/intel/lx_brand/Makefile b/usr/src/uts/intel/lx_brand/Makefile index 4eff474a49..f224d34028 100644 --- a/usr/src/uts/intel/lx_brand/Makefile +++ b/usr/src/uts/intel/lx_brand/Makefile @@ -21,11 +21,7 @@ # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# Copyright 2017 Joyent, Inc. -# -# This makefile drives the production of the kernel component of -# the lx brand -# +# Copyright 2019 Joyent, Inc. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -81,6 +77,9 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON # Due to zfs_ioctl.h inlines. gcc catches non-inline ones during compilation. LINTTAGS += -erroff=E_STATIC_UNUSED +# needs work +SMATCH=off + # # Default build targets. # diff --git a/usr/src/uts/intel/lx_cgroup/Makefile b/usr/src/uts/intel/lx_cgroup/Makefile index 6f9116f32a..5ed230b2e3 100644 --- a/usr/src/uts/intel/lx_cgroup/Makefile +++ b/usr/src/uts/intel/lx_cgroup/Makefile @@ -10,7 +10,7 @@ # # -# Copyright 2015 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # UTSBASE = ../.. @@ -34,6 +34,9 @@ CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nbrand/lx_brand +# needs work +$(OBJS_DIR)/cgrps_vnops.o := SMOFF += signed + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/lx_devfs/Makefile b/usr/src/uts/intel/lx_devfs/Makefile index 1254f596eb..9b2bec89a9 100644 --- a/usr/src/uts/intel/lx_devfs/Makefile +++ b/usr/src/uts/intel/lx_devfs/Makefile @@ -10,7 +10,7 @@ # # -# Copyright 2015 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # UTSBASE = ../.. @@ -34,6 +34,9 @@ CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nbrand/lx_brand +# needs work +$(OBJS_DIR)/lxd_vnops.o := SMOFF += signed + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/lx_netlink/Makefile b/usr/src/uts/intel/lx_netlink/Makefile index 2ada8e28a6..a6cccec102 100644 --- a/usr/src/uts/intel/lx_netlink/Makefile +++ b/usr/src/uts/intel/lx_netlink/Makefile @@ -10,7 +10,7 @@ # # -# Copyright (c) 2014 Joyent, Inc. All rights reserved. +# Copyright 2019 Joyent, Inc. # # @@ -43,6 +43,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CPPFLAGS += -I$(UTSBASE)/common/brand/lx LDFLAGS += -dy -Ndrv/ip -Nfs/sockfs -Nbrand/lx_brand +# needs work +SMOFF += all_func_returns + # # Default build targets. # diff --git a/usr/src/uts/intel/lxautofs/Makefile b/usr/src/uts/intel/lxautofs/Makefile index 5de66af48f..25e93c7328 100644 --- a/usr/src/uts/intel/lxautofs/Makefile +++ b/usr/src/uts/intel/lxautofs/Makefile @@ -22,7 +22,7 @@ # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# Copyright 2016 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # # @@ -78,6 +78,9 @@ LDFLAGS += -dy -Nfs/nfs # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +# needs work +SMOFF += all_func_returns + # # Default build targets. # diff --git a/usr/src/uts/intel/lxprocfs/Makefile b/usr/src/uts/intel/lxprocfs/Makefile index c6ffec0199..d48cbc588b 100644 --- a/usr/src/uts/intel/lxprocfs/Makefile +++ b/usr/src/uts/intel/lxprocfs/Makefile @@ -25,11 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# This makefile drives the production of the lxprocfs file system -# kernel module. -# -# intel architecture dependent -# +# Copyright 2019 Joyent, Inc. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -61,6 +57,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nfs/procfs +# false positive +# needs work +$(OBJS_DIR)/lxpr_vnops.o := SMOFF += strcpy_overflow + # # Default build targets. # diff --git a/usr/src/uts/intel/nfp/Makefile b/usr/src/uts/intel/nfp/Makefile index 3acbc6a725..c9ad5ecd41 100644 --- a/usr/src/uts/intel/nfp/Makefile +++ b/usr/src/uts/intel/nfp/Makefile @@ -10,7 +10,7 @@ # # -# Copyright (c) 2014, Joyent, Inc +# Copyright 2019 Joyent, Inc. # # @@ -48,13 +48,16 @@ LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# Driver-specific flags +# Driver-specific flags # CPPFLAGS += -DCH_KERNELVER=270 LDFLAGS += -dy CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function +# 3rd party code +SMOFF += indenting + # # Default build targets. # diff --git a/usr/src/uts/intel/overlay/Makefile b/usr/src/uts/intel/overlay/Makefile index 645b888cbc..fbb895c1c2 100644 --- a/usr/src/uts/intel/overlay/Makefile +++ b/usr/src/uts/intel/overlay/Makefile @@ -10,7 +10,7 @@ # # -# Copyright 2015 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # UTSBASE = ../.. @@ -32,6 +32,8 @@ LDFLAGS += -dy -Nmisc/mac -Ndrv/dld -Nmisc/dls -Nmisc/ksocket LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +# needs work +SMATCH=off .KEEP_STATE: diff --git a/usr/src/uts/intel/vmxnet/Makefile b/usr/src/uts/intel/vmxnet/Makefile index 4f3ebcf5af..f9a1c5e165 100644 --- a/usr/src/uts/intel/vmxnet/Makefile +++ b/usr/src/uts/intel/vmxnet/Makefile @@ -17,8 +17,7 @@ # # CDDL HEADER END # -# Copyright (c) 2012, Joyent, Inc. All rights reserved. -# Use is subject to license terms. +# Copyright 2019 Joyent, Inc. # # @@ -64,6 +63,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CPPFLAGS += -I$(UTSBASE)/i86pc LDFLAGS += -dy -N misc/gld +# needs work +SMOFF += all_func_returns + # # Default build targets. # diff --git a/usr/src/uts/intel/vnd/Makefile b/usr/src/uts/intel/vnd/Makefile index b94d014eb7..94706d4359 100644 --- a/usr/src/uts/intel/vnd/Makefile +++ b/usr/src/uts/intel/vnd/Makefile @@ -10,7 +10,7 @@ # # -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # UTSBASE = ../.. @@ -38,6 +38,9 @@ LDFLAGS += -dy -Nmisc/neti -Nmisch/hook -Nfs/dev -Nmisc/gsqueue # CERRWARN += -_gcc=-Wno-unused-function +# needs work +SMOFF += or_vs_and + .KEEP_STATE: def: $(DEF_DEPS) |