public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] DynamicTablesPkg: Fix void pointer arithmetic
@ 2021-10-14 14:59 PierreGondois
  2021-10-20 10:14 ` Sami Mujawar
  0 siblings, 1 reply; 2+ messages in thread
From: PierreGondois @ 2021-10-14 14:59 UTC (permalink / raw)
  To: devel, Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <Pierre.Gondois@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@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] DynamicTablesPkg: Fix void pointer arithmetic
  2021-10-14 14:59 [PATCH 1/1] DynamicTablesPkg: Fix void pointer arithmetic PierreGondois
@ 2021-10-20 10:14 ` Sami Mujawar
  0 siblings, 0 replies; 2+ messages in thread
From: Sami Mujawar @ 2021-10-20 10:14 UTC (permalink / raw)
  To: Pierre.Gondois, devel, Alexei Fedorov

Hi Pierre,

Thank you for this fix.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar


On 14/10/2021 03:59 PM, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <Pierre.Gondois@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@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
>   }
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-20 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-14 14:59 [PATCH 1/1] DynamicTablesPkg: Fix void pointer arithmetic PierreGondois
2021-10-20 10:14 ` Sami Mujawar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox