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

Re: [PATCH 2/2] Fix warnings with new compiler


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Paul Durrant <xadimgnik@xxxxxxxxx>
  • Date: Tue, 8 Jun 2021 15:00:29 +0100
  • Delivery-date: Tue, 08 Jun 2021 14:00:33 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 03/06/2021 14:32, Owen Smith wrote:
- Disable C4061, enumerator 'value' in switch of 'type' is not explicitly
   handled by a case label
- C4063, case '3' is not a valid value for switch of enum 
'_XENBUS_STORE_PERMISSION_MASK'
   Adds XENBUS_STORE_PERM_READ_WRITE to _XENBUS_STORE_PERMISSION_MASK

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
  include/store_interface.h      | 1 +
  src/xenbus/store.c             | 2 +-
  vs2019/xen/xen.vcxproj         | 2 +-
  vs2019/xenbus/xenbus.vcxproj   | 2 +-
  vs2019/xenfilt/xenfilt.vcxproj | 2 +-
  5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/store_interface.h b/include/store_interface.h
index e1251dd..7742955 100644
--- a/include/store_interface.h
+++ b/include/store_interface.h
@@ -57,6 +57,7 @@ typedef enum _XENBUS_STORE_PERMISSION_MASK {
      XENBUS_STORE_PERM_NONE = 0,
      XENBUS_STORE_PERM_READ = 1,
      XENBUS_STORE_PERM_WRITE = 2,
+    XENBUS_STORE_PERM_READ_WRITE = 3,
  } XENBUS_STORE_PERMISSION_MASK;
/*! \typedef XENBUS_STORE_PERMISSION
diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index ce4c755..2fd2e19 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -1958,7 +1958,7 @@ StorePermissionToString(
          *Buffer = 'w';
          break;
- case XENBUS_STORE_PERM_READ | XENBUS_STORE_PERM_WRITE:
+    case XENBUS_STORE_PERM_READ_WRITE:

Really? The compiler can't figure that the 1|2 == 3 for itself? If we have to have this nonsense then could you call it "XENBUS_STORE_PERM_BOTH" (which better explains the 'b' below)?

  Thanks,

    Paul

          *Buffer = 'b';
          break;
diff --git a/vs2019/xen/xen.vcxproj b/vs2019/xen/xen.vcxproj
index 39b5bda..1bf6e1e 100644
--- a/vs2019/xen/xen.vcxproj
+++ b/vs2019/xen/xen.vcxproj
@@ -24,7 +24,7 @@
        
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
        <IntrinsicFunctions>true</IntrinsicFunctions>
        <WarningLevel>EnableAllWarnings</WarningLevel>
-      
<DisableSpecificWarnings>4146;4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      
<DisableSpecificWarnings>4061;4146;4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
        <MultiProcessorCompilation>true</MultiProcessorCompilation>
        <EnablePREfast>true</EnablePREfast>
      </ClCompile>
diff --git a/vs2019/xenbus/xenbus.vcxproj b/vs2019/xenbus/xenbus.vcxproj
index ff40c43..85f21a8 100644
--- a/vs2019/xenbus/xenbus.vcxproj
+++ b/vs2019/xenbus/xenbus.vcxproj
@@ -24,7 +24,7 @@
        <IntrinsicFunctions>true</IntrinsicFunctions>
        
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common;</AdditionalIncludeDirectories>
        <WarningLevel>EnableAllWarnings</WarningLevel>
-      
<DisableSpecificWarnings>4146;4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      
<DisableSpecificWarnings>4061;4146;4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
        <MultiProcessorCompilation>true</MultiProcessorCompilation>
        <EnablePREfast>true</EnablePREfast>
      </ClCompile>
diff --git a/vs2019/xenfilt/xenfilt.vcxproj b/vs2019/xenfilt/xenfilt.vcxproj
index b3ce00f..c797483 100644
--- a/vs2019/xenfilt/xenfilt.vcxproj
+++ b/vs2019/xenfilt/xenfilt.vcxproj
@@ -24,7 +24,7 @@
        <IntrinsicFunctions>true</IntrinsicFunctions>
        
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common;</AdditionalIncludeDirectories>
        <WarningLevel>EnableAllWarnings</WarningLevel>
-      
<DisableSpecificWarnings>4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      
<DisableSpecificWarnings>4061;4464;4711;4770;4548;4820;4668;4255;5045;6001;6054;26451;28196;30030;30029;%(DisableSpecificWarnings)</DisableSpecificWarnings>
        <MultiProcessorCompilation>true</MultiProcessorCompilation>
        <EnablePREfast>true</EnablePREfast>
      </ClCompile>





 


Rackspace

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