From 7a110f08cecad07812015bbceb6d4c9f7cd7caa3 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 9 Jan 2008 19:58:39 +0000 Subject: [PATCH] The U suffix on constants is an ANSI feature --- gram.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gram.c b/gram.c index 83f0a9f4b..6a2694572 100644 --- a/gram.c +++ b/gram.c @@ -752,12 +752,7 @@ static int yygrowstack() else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = yyssp - yyss; -#ifdef SIZE_MAX -#define YY_SIZE_MAX SIZE_MAX -#else -#define YY_SIZE_MAX 0xffffffffU -#endif - if (newsize && YY_SIZE_MAX / newsize < sizeof *newss) + if (newsize && (size_t)-1 / newsize < sizeof *newss) goto bail; newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) : (short *)malloc(newsize * sizeof *newss); /* overflow check above */ @@ -765,7 +760,7 @@ static int yygrowstack() goto bail; yyss = newss; yyssp = newss + i; - if (newsize && YY_SIZE_MAX / newsize < sizeof *newvs) + if (newsize && (size_t)-1 / newsize < sizeof *newvs) goto bail; newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) : (YYSTYPE *)malloc(newsize * sizeof *newvs); /* overflow check above */ -- 2.40.0