Don't use %td (use %lu instead) in pcre2test under MSVC.

This commit is contained in:
Philip.Hazel 2017-02-04 16:27:20 +00:00
parent 4311f49d0e
commit 2f1e99e04f
2 changed files with 17 additions and 8 deletions

View File

@ -219,6 +219,8 @@ compliant and unique.
wrong name.
27. In pcre2test, give some offset information for errors in hex patterns.
This uses the C99 formatting sequence %td, except for MSVC which doesn't
support it - %lu is used instead.
28. Implemented pcre2_code_copy_with_tables(), and added pushtablescopy to
pcre2test for testing it.
@ -329,13 +331,13 @@ JIT.
AC_USE_SYSTEM_EXTENSIONS macro and to test for functions used by the JIT
modules.
52. Minor fixed to pcre2grep from Jason Hood:
52. Minor fixes to pcre2grep from Jason Hood:
* fixed some spacing;
* Windows doesn't usually use single quotes, so I've added a define
to use appropriate quotes [in an example];
* LC_ALL was displayed as "LCC_ALL";
* numbers 11, 12 & 13 should end in "th".
* use double quotes in usage message
* numbers 11, 12 & 13 should end in "th";
* use double quotes in usage message.
Version 10.22 29-July-2016

View File

@ -158,6 +158,13 @@ patterns. */
void vms_setsymbol( char *, char *, int );
#endif
/* VC doesn't support "%td". */
#ifdef _MSC_VER
#define PTR_SPEC "%lu"
#else
#define PTR_SPEC "%td"
#endif
/* ------------------End of system-specific definitions -------------------- */
/* Glueing macros that are used in several places below. */
@ -4663,7 +4670,7 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
if (d == 0)
{
fprintf(outfile, "** Missing closing quote in hex pattern: "
"opening quote is at offset %td.\n", pq - buffer - 2);
"opening quote is at offset " PTR_SPEC ".\n", pq - buffer - 2);
return PR_SKIP;
}
if (d == c) break;
@ -4677,8 +4684,8 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
{
if (!isxdigit(c))
{
fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset %td "
"in hex pattern: quote missing?\n", c, pp - buffer - 2);
fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset "
PTR_SPEC " in hex pattern: quote missing?\n", c, pp - buffer - 2);
return PR_SKIP;
}
if (*pp == 0)
@ -4689,8 +4696,8 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0)
d = *pp;
if (!isxdigit(d))
{
fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset %td "
"in hex pattern: quote missing?\n", d, pp - buffer - 1);
fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset "
PTR_SPEC " in hex pattern: quote missing?\n", d, pp - buffer - 1);
return PR_SKIP;
}
c = toupper(c);