checkAPIs.pl: fix false positive in value_string.h

check_value_string_arrays accidentally considered a part of
value_string.h as value_string definition:

    Error: epan/value_string.h                : {0, NULL} is required as the last value_string array entry: value_string array_name[]
    #define _VS_ARRAY_TYPE_NAME(array_name) const value_string array_name[]

    #define _VS_ENUM_ENTRY( name, value, string) name

Stripping all pre-processor statements (like #define) would be one way
to solve it, but at least one function checks for the presence of a
macro, so instead forbid '#' in the regex for variable name.

Change-Id: I4f47b3a42714c5bc526b0ecd8d2fb1ab076d00a2
Fixes: v2.9.0rc0-1929-g73644b3f76 ("checkAPIs.pl: speed up check_value_string_arrays and remove_if0_code")
Reviewed-on: https://code.wireshark.org/review/30391
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2018-10-26 15:58:04 +02:00
parent 4a2739ec88
commit 52d60cac72
1 changed files with 1 additions and 1 deletions

View File

@ -406,7 +406,7 @@ my $StaticRegex = qr/ static \s+
my $ConstRegex = qr/ const \s+ /xs;
my $Static_andor_ConstRegex = qr/ (?: $StaticRegex $ConstRegex | $StaticRegex | $ConstRegex) /xs;
my $ValueStringVarnameRegex = qr/ (?:value|val64|string|range|bytes)_string /xs;
my $ValueStringRegex = qr/ $Static_andor_ConstRegex ($ValueStringVarnameRegex) \ + [^;*]+ = [^;]+ [{] .+? [}] \s*? ; /xs;
my $ValueStringRegex = qr/ $Static_andor_ConstRegex ($ValueStringVarnameRegex) \ + [^;*#]+ = [^;]+ [{] .+? [}] \s*? ; /xs;
my $EnumValRegex = qr/ $Static_andor_ConstRegex enum_val_t \ + [^;*]+ = [^;]+ [{] .+? [}] \s*? ; /xs;
my $NewlineStringRegex = qr/ ["] [^"]* \\n [^"]* ["] /xs;