From: Ulya Trofimovich Date: Tue, 5 Mar 2019 10:50:00 +0000 (+0000) Subject: Respect platforms with 32-bit 'long' and 64-bit pointers. X-Git-Tag: 1.2~121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40b7de0f025e142e94f89f1e2fe89e8e45772d91;p=re2c 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. --- 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() {