diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-09-20 19:02:37 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-09-20 19:02:37 -0400 |
commit | 979b374813e960a9536d886e8c96182db02e6078 (patch) | |
tree | 9546382455c4943f4fd16d860e6fc6fc763e9dbe /gcc | |
parent | 16b02ae0924b6a63ddd7b08bdbbaf1402fb37303 (diff) | |
download | gcc-979b374813e960a9536d886e8c96182db02e6078.zip gcc-979b374813e960a9536d886e8c96182db02e6078.tar.gz gcc-979b374813e960a9536d886e8c96182db02e6078.tar.bz2 |
(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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cexp.y | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -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; |