[edk2-devel] [PATCH 1/1] DynamicTablesPkg: Fix void pointer arithmetic

PierreGondois pierre.gondois at arm.com
Thu Oct 14 14:59:22 UTC 2021


From: Pierre Gondois <Pierre.Gondois at arm.com>

Building the DynamicTablesPkg with the additional
-Wpointer-arith flag triggers the following error:
  "pointer of type ‘void *’ used in arithmetic
  [-Werror=pointer-arith]"

Cast the void pointer to fix the error.

Signed-off-by: Pierre Gondois <Pierre.Gondois at arm.com>
---
 .../Common/TableHelperLib/ConfigurationManagerObjectParser.c    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 2337d47e3fb3..0bdbfbb99c33 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -641,7 +641,7 @@ PrintCmObjDesc (
         ));
     }
     DEBUG ((DEBUG_ERROR, "\n"));
-    Data += Parser[Index].Length;
+    Data = (UINT8*)Data + Parser[Index].Length;
   } // for
 }
 
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82034): https://edk2.groups.io/g/devel/message/82034
Mute This Topic: https://groups.io/mt/86315767/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list