2015-09-11 11:35:43 +02:00
|
|
|
## @file
|
2015-09-08 09:10:03 +02:00
|
|
|
# EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
|
|
|
|
#
|
2019-12-27 07:28:20 +01:00
|
|
|
# Copyright (c) 2018-2020, Intel Corporation. All rights reserved.<BR>
|
2015-11-03 03:43:03 +01:00
|
|
|
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
2015-09-08 09:10:03 +02:00
|
|
|
#
|
2019-04-04 01:05:13 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2015-09-08 09:10:03 +02:00
|
|
|
##
|
|
|
|
|
|
|
|
[Defines]
|
|
|
|
INF_VERSION = 0x00010018
|
|
|
|
BASE_NAME = RegularExpressionDxe
|
|
|
|
FILE_GUID = 3E197E9C-D8DC-42D3-89CE-B04FA9833756
|
|
|
|
MODULE_TYPE = UEFI_DRIVER
|
|
|
|
VERSION_STRING = 1.0
|
|
|
|
ENTRY_POINT = RegularExpressionDxeEntry
|
|
|
|
|
|
|
|
[Sources]
|
|
|
|
RegularExpressionDxe.c
|
|
|
|
RegularExpressionDxe.h
|
2019-12-27 07:28:20 +01:00
|
|
|
OnigurumaUefiPort.h
|
|
|
|
OnigurumaUefiPort.c
|
|
|
|
|
|
|
|
# Wrapper header files start #
|
|
|
|
stdio.h
|
|
|
|
stdarg.h
|
|
|
|
stddef.h
|
|
|
|
stdlib.h
|
|
|
|
string.h
|
|
|
|
config.h
|
|
|
|
# Wrapper header files end #
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
# Upstream Oniguruma code
|
2019-12-27 07:28:20 +01:00
|
|
|
oniguruma/src/onig_init.c
|
|
|
|
oniguruma/src/oniguruma.h
|
|
|
|
oniguruma/src/regcomp.c
|
|
|
|
oniguruma/src/regenc.c
|
|
|
|
oniguruma/src/regenc.h
|
|
|
|
oniguruma/src/regerror.c
|
|
|
|
oniguruma/src/regexec.c
|
|
|
|
oniguruma/src/oniggnu.h
|
|
|
|
oniguruma/src/reggnu.c
|
|
|
|
oniguruma/src/regint.h
|
|
|
|
oniguruma/src/regparse.c
|
|
|
|
oniguruma/src/regparse.h
|
|
|
|
oniguruma/src/regposerr.c
|
|
|
|
oniguruma/src/onigposix.h
|
|
|
|
oniguruma/src/regposix.c
|
|
|
|
oniguruma/src/regsyntax.c
|
|
|
|
oniguruma/src/regtrav.c
|
|
|
|
oniguruma/src/regversion.c
|
|
|
|
oniguruma/src/st.c
|
|
|
|
oniguruma/src/st.h
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
# Supported Character Encodings
|
2019-12-27 07:28:20 +01:00
|
|
|
oniguruma/src/ascii.c
|
|
|
|
oniguruma/src/unicode.c
|
|
|
|
oniguruma/src/unicode_fold1_key.c
|
|
|
|
oniguruma/src/unicode_fold2_key.c
|
|
|
|
oniguruma/src/unicode_fold3_key.c
|
|
|
|
oniguruma/src/unicode_unfold_key.c
|
|
|
|
oniguruma/src/utf16_le.c
|
|
|
|
oniguruma/src/utf8.c
|
|
|
|
oniguruma/src/utf16_be.c
|
|
|
|
oniguruma/src/euc_jp.c
|
|
|
|
oniguruma/src/sjis.c
|
|
|
|
oniguruma/src/sjis_prop.c
|
|
|
|
oniguruma/src/euc_jp_prop.c
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
[Packages]
|
|
|
|
MdePkg/MdePkg.dec
|
|
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
|
|
|
|
|
|
[LibraryClasses]
|
|
|
|
UefiBootServicesTableLib
|
|
|
|
UefiDriverEntryPoint
|
|
|
|
MemoryAllocationLib
|
|
|
|
BaseMemoryLib
|
|
|
|
DebugLib
|
2015-11-03 03:44:48 +01:00
|
|
|
PrintLib
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
[Guids]
|
2015-09-11 11:35:43 +02:00
|
|
|
gEfiRegexSyntaxTypePosixExtendedGuid ## CONSUMES ## GUID
|
|
|
|
gEfiRegexSyntaxTypePerlGuid ## CONSUMES ## GUID
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
[Protocols]
|
2018-06-27 15:08:52 +02:00
|
|
|
gEfiRegularExpressionProtocolGuid ## PRODUCES
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
[BuildOptions]
|
2018-10-08 06:22:38 +02:00
|
|
|
# Enable STDARG for variable arguments
|
2019-12-27 07:28:20 +01:00
|
|
|
*_*_*_CC_FLAGS = -DHAVE_STDARG_H -U_WIN32 -DONIG_VARIADIC_FUNC_ATTR=EFIAPI
|
2018-10-08 06:22:38 +02:00
|
|
|
|
2015-09-08 09:10:03 +02:00
|
|
|
# Override MSFT build option to remove /Oi and /GL
|
2018-09-06 10:04:58 +02:00
|
|
|
MSFT:*_*_*_CC_FLAGS = /GL-
|
|
|
|
INTEL:*_*_*_CC_FLAGS = /Oi-
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
# Oniguruma: potentially uninitialized local variable used
|
2018-09-26 11:45:43 +02:00
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4701 /wd4703
|
2015-09-08 09:10:03 +02:00
|
|
|
|
|
|
|
# Oniguruma: intrinsic function not declared
|
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4164
|
|
|
|
|
|
|
|
# Oniguruma: old style declaration in st.c
|
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4131
|
|
|
|
|
2018-06-27 15:08:52 +02:00
|
|
|
# Oniguruma: 'type cast' : truncation from 'OnigUChar *' to 'unsigned int'
|
2015-09-08 09:10:03 +02:00
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4305 /wd4306
|
|
|
|
|
2018-09-06 10:04:58 +02:00
|
|
|
# Oniguruma: nameless union declared in regparse.h
|
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4201
|
|
|
|
|
|
|
|
# Oniguruma: 'type cast' : "int" to "OnigUChar", function pointer to "void *"
|
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4244 /wd4054
|
|
|
|
|
|
|
|
# Oniguruma: previous local declaration
|
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4456
|
|
|
|
|
|
|
|
# Oniguruma: signed and unsigned mismatch/cast
|
2019-12-27 07:28:20 +01:00
|
|
|
MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389 /wd4090
|
2018-09-06 10:04:58 +02:00
|
|
|
|
MdeModulePkg/RegularExpressionDxe:disable wraning to pass gcc4.8 build
There are three warnings reported by GCC 4.8 and the later GCC release
are workaround with them.
And all the three warnings are invalid,so I just disable warnings rather
than fix them at now.
Following is the analysis from Laszlo Ersek.
(1)
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c: In
> function 'compile_length_tree':
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c:1516:7:
> warning: 'len' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> int len;
> ^
I think this is an invalid warning; the type of the controlling expression
(node->type) is enum GimmickType, and the case labels cover all values of
the enum. An assert(0) could be added, I guess, but again, upstream
Oniguruma would be justified to reject the idea.
(2)
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c: In
> function 'parse_callout_args.isra.10.constprop.30':
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c:6753:25:
> warning: 'rl' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> vals[n].l = rl;
> ^
This warning is invalid, given:
6749 if (cn > 0) {
6750 long rl;
6751 r = parse_long(enc, buf, bufend, 1, LONG_MAX, &rl);
6752 if (r == ONIG_NORMAL) {
6753 vals[n].l = rl;
Because parse_long() only returns ONIG_NORMAL after it sets (*rl).
(3)
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c: In
> function 'parse_callout_of_name.constprop.29':
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c:6861:38:
> warning: 'tag_end' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> if (! is_allowed_callout_tag_name(enc, tag_start, tag_end))
This warning is also invalid, given:
6852 if (c == '[') {
6853 if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
6854 tag_start = p;
6855 while (! PEND) {
6856 if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
6857 tag_end = p;
6858 PFETCH_S(c);
6859 if (c == ']') break;
6860 }
6861 if (! is_allowed_callout_tag_name(enc, tag_start, tag_end))
6862 return ONIGERR_INVALID_CALLOUT_TAG_NAME;
6863
To see that, first we should note:
#define PEND (p < end ? 0 : 1)
therefore PEND doesn't change if neither "p" nor "end" change.
Second, when we reach line 6855 (the "while") for the very first time,
(!PEND) is certainly true (i.e., PEND is false), because otherwise we
would have bailed at line 6853. Therefore we reach line 6857, and assign
"tag_end". Regardless of whether we iterate zero or more *additional*
times around the loop, "tag_end" will have been set, whenever we reach
line 6861.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-10-10 09:39:03 +02:00
|
|
|
# Oniguruma: tag_end in parse_callout_of_name
|
|
|
|
GCC:*_*_*_CC_FLAGS = -Wno-error=maybe-uninitialized
|
2018-11-01 14:36:09 +01:00
|
|
|
|
2019-10-17 08:55:51 +02:00
|
|
|
# Oniguruma: implicit conversion from 'UINTN' (aka 'unsigned long long') to 'long'
|
2019-11-14 09:02:18 +01:00
|
|
|
GCC:*_CLANGPDB_*_CC_FLAGS = -Wno-error=constant-conversion
|
2019-10-17 08:55:51 +02:00
|
|
|
|
2018-10-26 04:33:24 +02:00
|
|
|
# Not add -Wno-error=maybe-uninitialized option for XCODE
|
|
|
|
# XCODE doesn't know this option
|
|
|
|
XCODE:*_*_*_CC_FLAGS =
|