The U suffix on constants is an ANSI feature

This commit is contained in:
Todd C. Miller
2008-01-09 19:58:39 +00:00
parent 1df9ca2dc1
commit 7a110f08ce

9
gram.c
View File

@@ -752,12 +752,7 @@ static int yygrowstack()
else if ((newsize *= 2) > YYMAXDEPTH) else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH; newsize = YYMAXDEPTH;
i = yyssp - yyss; i = yyssp - yyss;
#ifdef SIZE_MAX if (newsize && (size_t)-1 / newsize < sizeof *newss)
#define YY_SIZE_MAX SIZE_MAX
#else
#define YY_SIZE_MAX 0xffffffffU
#endif
if (newsize && YY_SIZE_MAX / newsize < sizeof *newss)
goto bail; goto bail;
newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) : newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
(short *)malloc(newsize * sizeof *newss); /* overflow check above */ (short *)malloc(newsize * sizeof *newss); /* overflow check above */
@@ -765,7 +760,7 @@ static int yygrowstack()
goto bail; goto bail;
yyss = newss; yyss = newss;
yyssp = newss + i; yyssp = newss + i;
if (newsize && YY_SIZE_MAX / newsize < sizeof *newvs) if (newsize && (size_t)-1 / newsize < sizeof *newvs)
goto bail; goto bail;
newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) : newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
(YYSTYPE *)malloc(newsize * sizeof *newvs); /* overflow check above */ (YYSTYPE *)malloc(newsize * sizeof *newvs); /* overflow check above */