From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2CDA321163277 for ; Mon, 8 Oct 2018 02:51:58 -0700 (PDT) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 08 Oct 2018 11:51:56 +0200 Received: from GaryWorkstation ([10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Mon, 08 Oct 2018 10:51:44 +0100 Date: Mon, 8 Oct 2018 17:51:38 +0800 From: Gary Lin To: Dongao Guo Cc: edk2-devel@lists.01.org, Liming Gao Message-ID: <20181008095138.GA18925@GaryWorkstation> References: <1538985408-16028-1-git-send-email-dongao.guo@intel.com> MIME-Version: 1.0 In-Reply-To: <1538985408-16028-1-git-send-email-dongao.guo@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 09:51:59 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 08, 2018 at 03:56:48PM +0800, Dongao Guo wrote: > > comment unused variable to avoid warning,and modify inf build option. > Why not just remove the variables altogether instead of commenting them out? Is it on purpose? Gary Lin > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dongao Guo > --- > .../RegularExpressionDxe/Oniguruma/regexec.c | 28 +++++++++++----------- > .../RegularExpressionDxe/RegularExpressionDxe.inf | 3 --- > 2 files changed, 14 insertions(+), 17 deletions(-) > > diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c > index 7b0fda0..26e7a31 100644 > --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c > +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c > @@ -5603,11 +5603,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data) > int r; > int num; > size_t tag_len; > - const UChar* start; > - const UChar* right; > - const UChar* current; > - const UChar* string; > - const UChar* strend; > + // const UChar* start; > + // const UChar* right; > + // const UChar* current; > + // const UChar* string; > + // const UChar* strend; > const UChar* tag_start; > const UChar* tag_end; > regex_t* reg; > @@ -5615,9 +5615,9 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data) > OnigType type; > OnigValue val; > char buf[20]; > - FILE* fp; > + // FILE* fp; > > - fp = OutFp; > + // fp = OutFp; > > r = onig_get_arg_by_callout_args(args, 0, &type, &val); > if (r != ONIG_NORMAL) return r; > @@ -5633,11 +5633,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data) > } > > num = onig_get_callout_num_by_callout_args(args); > - start = onig_get_start_by_callout_args(args); > - right = onig_get_right_range_by_callout_args(args); > - current = onig_get_current_by_callout_args(args); > - string = onig_get_string_by_callout_args(args); > - strend = onig_get_string_end_by_callout_args(args); > + // start = onig_get_start_by_callout_args(args); > + // right = onig_get_right_range_by_callout_args(args); > + // current = onig_get_current_by_callout_args(args); > + // string = onig_get_string_by_callout_args(args); > + // strend = onig_get_string_end_by_callout_args(args); > reg = onig_get_regex_by_callout_args(args); > tag_start = onig_get_callout_tag_start(reg, num); > tag_end = onig_get_callout_tag_end(reg, num); > @@ -5653,7 +5653,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data) > for (i = 0; i < tag_len; i++) buf[i] = tag_start[i]; > buf[tag_len] = '\0'; > } > - > +/* > fprintf(fp, "ONIG-MONITOR: %-4s %s at: %d [%d - %d] len: %d\n", > buf, > in == ONIG_CALLOUT_IN_PROGRESS ? "=>" : "<=", > @@ -5662,7 +5662,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data) > (int )(right - string), > (int )(strend - string)); > //fflush(fp); > - > +*/ > return ONIG_CALLOUT_SUCCESS; > } > > diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf > index 16e91bd..98fb8db 100644 > --- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf > +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf > @@ -106,6 +106,3 @@ > > # Oniguruma: signed and unsigned mismatch/cast > MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389 > - > - # Oniguruma: error: variable 'fp' set but not used > - GCC:*_*_*_CC_FLAGS = -Wno-error=unused-but-set-variable > -- > 1.9.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >