svn commit: r312531 - head/sys/amd64/vmm

Andriy Gapon avg at FreeBSD.org
Fri Jan 20 13:21:29 UTC 2017


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;
 	}


More information about the svn-src-head mailing list