From 979b374813e960a9536d886e8c96182db02e6078 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Tue, 20 Sep 1994 19:02:37 -0400 Subject: [PATCH] (HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT): New macros. (expression_value): Now HOST_WIDE_INT. (parse_c_expression): Now returns HOST_WIDE_INT. From-SVN: r8106 --- gcc/cexp.y | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/gcc/cexp.y b/gcc/cexp.y index 0914ee354727..d64d01336d94 100644 --- a/gcc/cexp.y +++ b/gcc/cexp.y @@ -1,5 +1,5 @@ /* Parse C expressions for CCCP. - Copyright (C) 1987, 1992 Free Software Foundation. + Copyright (C) 1987, 1992, 1994 Free Software Foundation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -59,13 +59,27 @@ struct arglist { #endif #endif +/* Find the largest host integer type and set its size and type. */ + +#ifndef HOST_BITS_PER_WIDE_INT + +#if HOST_BITS_PER_LONG > HOST_BITS_PER_INT +#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG +#define HOST_WIDE_INT long +#else +#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT +#define HOST_WIDE_INT int +#endif + +#endif + #ifndef NULL_PTR #define NULL_PTR ((GENERIC_PTR)0) #endif int yylex (); void yyerror (); -int expression_value; +HOST_WIDE_INT expression_value; static jmp_buf parse_return_error; @@ -905,7 +919,7 @@ right_shift (a, b) /* We do not support C comments. They should be removed before this function is called. */ -int +HOST_WIDE_INT parse_c_expression (string) char *string; { @@ -954,7 +968,7 @@ main () if (buf[n] == EOF) break; buf[n] = '\0'; - printf ("parser returned %d\n", parse_c_expression (buf)); + printf ("parser returned %ld\n", parse_c_expression (buf)); } return 0; -- 2.43.5