|
@@ -392,7 +392,7 @@ our $Binary = qr{(?i)0b[01]+$Int_type?};
|
|
our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?};
|
|
our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?};
|
|
our $Int = qr{[0-9]+$Int_type?};
|
|
our $Int = qr{[0-9]+$Int_type?};
|
|
our $Octal = qr{0[0-7]+$Int_type?};
|
|
our $Octal = qr{0[0-7]+$Int_type?};
|
|
-our $String = qr{"[X\t]*"};
|
|
|
|
|
|
+our $String = qr{(?:\bL)?"[X\t]*"};
|
|
our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?};
|
|
our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?};
|
|
our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?};
|
|
our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?};
|
|
our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?};
|
|
our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?};
|
|
@@ -5254,13 +5254,14 @@ sub process {
|
|
}
|
|
}
|
|
|
|
|
|
# concatenated string without spaces between elements
|
|
# concatenated string without spaces between elements
|
|
- if ($line =~ /$String[A-Z_]/ || $line =~ /[A-Za-z0-9_]$String/) {
|
|
|
|
|
|
+ if ($line =~ /$String[A-Z_]/ ||
|
|
|
|
+ ($line =~ /([A-Za-z0-9_]+)$String/ && $1 !~ /^L$/)) {
|
|
CHK("CONCATENATED_STRING",
|
|
CHK("CONCATENATED_STRING",
|
|
"Concatenated strings should use spaces between elements\n" . $herecurr);
|
|
"Concatenated strings should use spaces between elements\n" . $herecurr);
|
|
}
|
|
}
|
|
|
|
|
|
# uncoalesced string fragments
|
|
# uncoalesced string fragments
|
|
- if ($line =~ /$String\s*"/) {
|
|
|
|
|
|
+ if ($line =~ /$String\s*L?"/) {
|
|
WARN("STRING_FRAGMENTS",
|
|
WARN("STRING_FRAGMENTS",
|
|
"Consecutive strings are generally better as a single string\n" . $herecurr);
|
|
"Consecutive strings are generally better as a single string\n" . $herecurr);
|
|
}
|
|
}
|