winflexbison icon indicating copy to clipboard operation
winflexbison copied to clipboard

YYPTRDIFF_T not 64bit compatible?

Open danielmarschall opened this issue 1 year ago • 0 comments

When I compile my app with Win64, I receive the following compiler warning

1>/y.tab.c(1366,41): warning C4244: "Initialisierung": Converting from "__int64" to "long", possible data loss

The line:

      /* Get the current used size of the three stacks, in elements.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

The definition:

#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX

I wonder, shouldn't the definition be changed to this?

#ifdef _WIN64
#  define YYPTRDIFF_T long long
#  define YYPTRDIFF_MAXIMUM LLONG_MAX
#else
#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX
#endif

danielmarschall avatar Jun 02 '24 18:06 danielmarschall