Thanks for your comments I'll update the patch. -Shumin -----Original Message----- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard Biesheuvel Sent: Thursday, September 17, 2015 4:56 PM To: Qiu, Shumin Cc: Carsey, Jaben; Ni, Ruiyu; edk2-devel@lists.01.org; Yang, Jadis Subject: Re: [edk2] [PATCH] ShellPkg: Fix GCC build fail.
On 17 September 2015 at 05:04, Qiu Shumin <shumin....@intel.com> wrote: > Cc: Jaben Carsey <jaben.car...@intel.com> > Cc: Ruiyu Ni <ruiyu...@intel.com> > Cc: Yang Jadis <jadis.y...@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Qiu Shumin <shumin....@intel.com> > --- > ShellPkg/Application/Shell/ShellParametersProtocol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c > b/ShellPkg/Application/Shell/ShellParametersProtocol.c > index b404987..a152474 100644 > --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c > +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c > @@ -206,7 +206,7 @@ ParseCommandLineToArgs( > return (EFI_SUCCESS); > } > > - TrimSpaces(&(CHAR16*)CommandLine); > + TrimSpaces((CHAR16**)(&CommandLine)); OK, I did not spot this patch before commenting on the original one. As I commented there, you are casting away constness to allow TrimSpaces() to modify an input argument that we promised not to touch. The only option is to make a copy of CommandLine and work with that in the remainder of the function. > Size = StrSize(CommandLine); > TempParameter = AllocateZeroPool(Size); > if (TempParameter == NULL) { > -- > 1.9.5.msysgit.1 > > _______________________________________________ > 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