version 1.2, 2004/05/12 21:28:35 |
version 1.3, 2006/01/20 23:10:19 |
|
|
#include "parser.h" |
#include "parser.h" |
#include <stdlib.h> |
#include <stdlib.h> |
#include <errno.h> |
#include <errno.h> |
#include <sys/types.h> |
#include <stdint.h> |
#include <limits.h> |
#include <limits.h> |
|
|
extern int32_t yylval; |
extern int32_t yylval; |
|
|
errno = 0; |
errno = 0; |
l = strtol(yytext, NULL, 0); |
l = strtol(yytext, NULL, 0); |
if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || |
if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || |
l > 0x7fffffff || l < (-0x7fffffff - 1)) { |
l > INT32_MAX || l < INT32_MIN) { |
fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); |
fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); |
} |
} |
return l; |
return l; |