Date: Fri, 20 Jan 2017 13:21:27 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312531 - head/sys/amd64/vmm Message-ID: <201701201321.v0KDLRRu040415@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri Jan 20 13:21:27 2017 New Revision: 312531 URL: https://svnweb.freebsd.org/changeset/base/312531 Log: vmm_dev: work around a bogus error with gcc 6.3.0 The error is: vmm_dev.c: In function 'alloc_memseg': vmm_dev.c:261:11: error: null argument where non-null required (argument 1) [-Werror=nonnull] Apparently, the gcc is unable to figure out that if a ternary operator produced a non-NULL value once, then the operator with exactly the same operands would produce the same value again. MFC after: 1 week Modified: head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Fri Jan 20 13:01:25 2017 (r312530) +++ head/sys/amd64/vmm/vmm_dev.c Fri Jan 20 13:21:27 2017 (r312531) @@ -258,7 +258,7 @@ alloc_memseg(struct vmmdev_softc *sc, st if (VM_MEMSEG_NAME(mseg)) { sysmem = false; name = malloc(SPECNAMELEN + 1, M_VMMDEV, M_WAITOK); - error = copystr(VM_MEMSEG_NAME(mseg), name, SPECNAMELEN + 1, 0); + error = copystr(mseg->name, name, SPECNAMELEN + 1, 0); if (error) goto done; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701201321.v0KDLRRu040415>