From 40b7de0f025e142e94f89f1e2fe89e8e45772d91 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 5 Mar 2019 10:50:00 +0000 Subject: [PATCH] Respect platforms with 32-bit 'long' and 64-bit pointers. Previously used ~0U works incorrectly in such cases: ~0U equals 0xFFFFffff, and maximum (numerical) pointer value is 0xFFFFffffFFFFffff. This caused incorrect comparison result when tracking include files that have been fully processed and can be removed frm the include stack. Problem report thanks to Denis Naumov. --- re2c/src/parse/scanner.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re2c/src/parse/scanner.cc b/re2c/src/parse/scanner.cc index 9194005d..23dc65d8 100644 --- a/re2c/src/parse/scanner.cc +++ b/re2c/src/parse/scanner.cc @@ -6,7 +6,7 @@ namespace re2c { -const char *const Scanner::ENDPOS = (const char*) ~0LU; +const char *const Scanner::ENDPOS = (const char*) UINTMAX_MAX; Scanner::~Scanner() { -- 2.50.1