@@ -95,16 +95,18 @@ grep "PROTECT_PTR" ./src/*.c
9595# No use of long long, instead use int64_t. TODO
9696# grep " long long" ./src/*.c
9797
98- // No use of llu, lld, zd or zu
99- grep -nE " (llu|lld|zd|zu) " src/*.[hc]
98+ // No use of llu, lld, td or tu
99+ grep -nE " %(ll|t)[ud]\b " src/*.[hc]
100100// Comment moved here from fread.c on 19 Nov 2019
101101// [Moved from fread.c on 19 Nov 2019] On Windows variables of type `size_t` cannot be printed
102- // with " %zu" in the `snprintf()` function. For those variables we used to cast them into
103- // `unsigned long long int` before printing, and defined (llu) to make the cast shorter.
104- // We're now observing warnings from gcc-8 with -Wformat-extra-args, #4062. So
105- // now we're more strict and cast to [u]int64_t and use PRIu64/PRId64 from < inttypes.h>
106- // In many cases the format specifier is passed to our own macro (e.g. DTPRINT) or to Rprintf(),
107- // error() etc, and even if they don't call sprintf() now, they could in future.
102+ // with " %zu" in the `snprintf()` function. For those variables we used to cast them into
103+ // `unsigned long long int` before printing, and defined (llu) to make the cast shorter.
104+ // We're now observing warnings from gcc-8 with -Wformat-extra-args, #4062. So
105+ // now we're more strict and cast to [u]int64_t and use PRIu64/PRId64 from < inttypes.h>
106+ // In many cases the format specifier is passed to our own macro (e.g. DTPRINT) or to Rprintf(),
107+ // error() etc, and even if they don't call sprintf() now, they could in future.
108+ // td is for ptrdiff_t from C99; it's not available in old versions of Rtools (e.g. for R< 4.2.0),
109+ // see https://github.com/Rdatatable/data.table/pull/6970#issuecomment-2877636459.
108110
109111# No tabs in C or R code (sorry, Richard Hendricks)
110112grep -P " \t" ./R/*.R
0 commit comments