Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 2017 05:01:00 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326144 - head/stand/userboot/test
Message-ID:  <201711240501.vAO510ON009618@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Nov 24 05:01:00 2017
New Revision: 326144
URL: https://svnweb.freebsd.org/changeset/base/326144

Log:
  Mark the func pointer as __dead2. It looks up loader_main, which
  either aborts or exits, but never returns. Tag it as a non-returning
  function rather than supply a bogus return(0) at the end of main.
  
  CID: 1382885
  Sponsored by: Netflix

Modified:
  head/stand/userboot/test/test.c

Modified: head/stand/userboot/test/test.c
==============================================================================
--- head/stand/userboot/test/test.c	Fri Nov 24 05:00:25 2017	(r326143)
+++ head/stand/userboot/test/test.c	Fri Nov 24 05:01:00 2017	(r326144)
@@ -422,7 +422,7 @@ int
 main(int argc, char** argv)
 {
 	void *h;
-	void (*func)(struct loader_callbacks *, void *, int, int);
+	void (*func)(struct loader_callbacks *, void *, int, int) __dead2;
 	int opt;
 	char *disk_image = NULL;
 	const char *userboot_obj = "/boot/userboot.so";



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711240501.vAO510ON009618>