[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix compilation of checked build



* Redefine XEN_API to __declspec(dllexport) to avoid declaring LogPrintf
  and similar symbols in the same binary as dllimport.
* The BUG() macro was not correctly identified as noreturn in checked
  builds, causing a warning about uninitialized variables. Use
  ASSERT(FALSE) (which does not signal unreachable code) and set the
  variable's value at the end instead.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xen/hypercall.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/xen/hypercall.c b/src/xen/hypercall.c
index 3c68709..fd7401a 100644
--- a/src/xen/hypercall.c
+++ b/src/xen/hypercall.c
@@ -30,6 +30,9 @@
  * SUCH DAMAGE.
  */
 
+#undef  XEN_API
+#define XEN_API __declspec(dllexport)
+
 #include <ntddk.h>
 #include <xen.h>
 #include <intrin.h>
@@ -188,7 +191,8 @@ __Hypercall(
             Value = hypercall2_vmmcall(ord, arg1, arg2);
             break;
         default:
-            BUG("NO HYPERCALL INSTRUCTION");
+            ASSERT(FALSE);
+            Value = 0;
         }
         break;
     }
@@ -206,7 +210,8 @@ __Hypercall(
             Value = hypercall3_vmmcall(ord, arg1, arg2, arg3);
             break;
         default:
-            BUG("NO HYPERCALL INSTRUCTION");
+            ASSERT(FALSE);
+            Value = 0;
         }
         break;
     }
-- 
2.53.0.windows.1



--
 | Vates

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.