Rework the analysis of the 'r' specifier. It turns out that we can't
make it like xArg because they are different ('x' doesn't accept sign, but 'r' does). This fixes some warnings when building DDB with clang. With help from: rdivacky
This commit is contained in:
parent
88660748b0
commit
72578a23bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213694
@ -147,6 +147,7 @@ class ConversionSpecifier {
|
||||
// FreeBSD specific specifiers
|
||||
bArg,
|
||||
DArg,
|
||||
rArg,
|
||||
|
||||
// GlibC specific specifiers.
|
||||
PrintErrno, // 'm'
|
||||
|
@ -423,6 +423,7 @@ bool FormatSpecifier::hasValidLengthModifier() const {
|
||||
case ConversionSpecifier::xArg:
|
||||
case ConversionSpecifier::XArg:
|
||||
case ConversionSpecifier::nArg:
|
||||
case ConversionSpecifier::rArg:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -448,6 +449,7 @@ bool FormatSpecifier::hasValidLengthModifier() const {
|
||||
case ConversionSpecifier::nArg:
|
||||
case ConversionSpecifier::cArg:
|
||||
case ConversionSpecifier::sArg:
|
||||
case ConversionSpecifier::rArg:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -195,7 +195,7 @@ static PrintfSpecifierResult ParsePrintfSpecifier(FormatStringHandler &H,
|
||||
case 'm': k = ConversionSpecifier::PrintErrno; break;
|
||||
// FreeBSD format extensions
|
||||
case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */
|
||||
case 'r': if (FormatExtensions) k = ConversionSpecifier::xArg; break;
|
||||
case 'r': if (FormatExtensions) k = ConversionSpecifier::rArg; break;
|
||||
case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break;
|
||||
case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */
|
||||
}
|
||||
@ -279,6 +279,7 @@ const char *ConversionSpecifier::toString() const {
|
||||
// FreeBSD specific specifiers.
|
||||
case bArg: return "b";
|
||||
case DArg: return "D";
|
||||
case rArg: return "r";
|
||||
|
||||
// GlibC specific specifiers.
|
||||
case PrintErrno: return "m";
|
||||
@ -491,6 +492,7 @@ bool PrintfSpecifier::hasValidPlusPrefix() const {
|
||||
case ConversionSpecifier::GArg:
|
||||
case ConversionSpecifier::aArg:
|
||||
case ConversionSpecifier::AArg:
|
||||
case ConversionSpecifier::rArg:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@ -514,6 +516,7 @@ bool PrintfSpecifier::hasValidAlternativeForm() const {
|
||||
case ConversionSpecifier::FArg:
|
||||
case ConversionSpecifier::gArg:
|
||||
case ConversionSpecifier::GArg:
|
||||
case ConversionSpecifier::rArg:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user