mirror of https://github.com/swig/swig.git
MSVC warned on 64 bit Windows: parser.c(5751,41): warning C4244: 'initializing': conversion from '__int64' to 'long', possible loss of data The bison template picks long for YYPTRDIFF_T when PTRDIFF_MAX is not defined, and it only includes stdint.h itself when __STDC_VERSION__ says C99 or later, which MSVC does not define by default. long is 32 bits on 64 bit Windows, so the pointer difference is truncated. Including stdint.h from the prologue, which is emitted well before the template code, makes PTRDIFF_MAX visible so ptrdiff_t is used instead. This is a no-op for GCC and Clang, which already take the __PTRDIFF_TYPE__ branch. Assisted-by: Claude Code (Opus 5) |
||
|---|---|---|
| .. | ||
| cparse.h | ||
| cscanner.c | ||
| parser.y | ||
| templ.c | ||
| util.c | ||