RegularExpressionDxe change is ok for me.

Reviewed-by: Feng Tian <feng.t...@inte.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Andrew 
Fish
Sent: Tuesday, November 10, 2015 23:33
To: Gao, Liming
Cc: edk2-devel; Tian, Feng
Subject: Re: [edk2] MdeModulePkg: Fix Xcode 6.3.2/clang compilation issues.


> On Nov 10, 2015, at 7:04 AM, Andrew Fish <af...@apple.com> wrote:
> 
> 
>> On Nov 10, 2015, at 12:06 AM, Gao, Liming <liming....@intel.com> wrote:
>> 
>> Andrew:
>> The patch is missing.
>> 
> 
> Liming,
> 
> My sent mail shows these 3 patches attached?
> 0001-MdeModulePkg-PeiCore-Fix-Xcode-Wempty-body-warning.patch
> 0002-MdeModulePkg-RegularExpressionDxe-Xcode-warnings-fix.patch
> 0003-MdeModulePkg-Variable-add-mising-VA_COPY.patch
> 
> I attached again here:
> 
> 

>cat 0002-MdeModulePkg-RegularExpressionDxe-Xcode-warnings-fix.patch
>From 7f82886d42a82d939760562ab3f992ae6a3a70b7 Mon Sep 17 00:00:00 2001
From: andrew fish <af...@apple.com>
Date: Mon, 9 Nov 2015 22:31:03 -0800
Subject: [PATCH 2/4] MdeModulePkg: RegularExpressionDxe Xcode warnings fixes

ErrorMessage generates a Wpointer-sign error, char * vs unsigned char * 
assigning structures with = generate memcpy link failures.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <af...@apple.com>
---
 MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c  | 9 ++++++--- 
 MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c | 2 +-
 .../Universal/RegularExpressionDxe/RegularExpressionDxe.c        | 4 ++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c
index 25b768b..7c9771f 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c
@@ -70,7 +70,10 @@ static void
 swap_node(Node* a, Node* b)
 {
   Node c;
-  c = *a; *a = *b; *b = c;
+  //c = *a; *a = *b; *b = c;
+  xmemcpy (&c, a, sizeof (Node));
+  xmemcpy (a, b, sizeof (Node));
+  xmemcpy (b, &c, sizeof (Node));
 
   if (NTYPE(a) == NT_STR) {
     StrNode* sn = NSTR(a);
@@ -4348,7 +4351,7 @@ clear_opt_map_info(OptMapInfo* map)  static void
 copy_opt_map_info(OptMapInfo* to, OptMapInfo* from)  {
-  *to = *from;
+  xmemcpy(to, from, sizeof(OptMapInfo));
 }
 
 static void
@@ -4463,7 +4466,7 @@ clear_node_opt_info(NodeOptInfo* opt)  static void
 copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from)  {
-  *to = *from;
+  xmemcpy(to, from, sizeof (NodeOptInfo));
 }
 
 static void
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
index 01ac2b3..38fceb4 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
@@ -2211,7 +2211,7 @@ onig_reduce_nested_quantifier(Node* pnode, Node* cnode)
 
   switch(ReduceTypeTable[cnum][pnum]) {
   case RQ_DEL:
-    *pnode = *cnode;
+    xmemcpy (pnode, cnode, sizeof (Node));
     break;
   case RQ_A:
     p->target = c->target;
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
index a3eebf7..453c1eb 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
@@ -120,7 +120,7 @@ OnigurumaMatch (
                  );
 
   if (OnigResult != ONIG_NORMAL) {
-    onig_error_code_to_str (ErrorMessage, OnigResult, &ErrorInfo);
+    onig_error_code_to_str ((OnigUChar *)ErrorMessage, OnigResult, 
+ &ErrorInfo);
     DEBUG ((DEBUG_ERROR, "Regex compilation failed: %a\n", ErrorMessage));
     return EFI_DEVICE_ERROR;
   }
@@ -144,7 +144,7 @@ OnigurumaMatch (
   } else {
     *Result = FALSE;
     if (OnigResult != ONIG_MISMATCH) {
-      onig_error_code_to_str (ErrorMessage, OnigResult);
+      onig_error_code_to_str ((OnigUChar *)ErrorMessage, OnigResult);
       DEBUG ((DEBUG_ERROR, "Regex match failed: %a\n", ErrorMessage));
     }
   }
--
2.3.2 (Apple Git-55)


> 
> 
> Thanks,
> 
> Andrew Fish
> 
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
>> Andrew Fish
>> Sent: Tuesday, November 10, 2015 3:18 PM
>> To: edk2-devel
>> Cc: Tian, Feng
>> Subject: [edk2] MdeModulePkg: Fix Xcode 6.3.2/clang compilation issues.
>> 
>> Please review the following patches as they are required to build with Xcode 
>> 6.3.2.
>> 
>> Thanks,
>> 
>> Andrew Fish
>> 
>> 
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
>> https://lists.01.org/mailman/listinfo/edk2-devel
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to