diff options
author | Kaveh R. Ghazi <ghazi@tragg.rutgers.edu> | 1997-12-20 11:31:54 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-12-20 04:31:54 -0700 |
commit | 1d300e19b61d11e3a2321a098b7949f6c2058be2 (patch) | |
tree | fb640fe4c8c99759602e3a82e0ed835789f267eb /gcc/cppexp.c | |
parent | afba61d1421cd6bc16d20fb4e5d8a10bf48a0b79 (diff) | |
download | gcc-1d300e19b61d11e3a2321a098b7949f6c2058be2.zip gcc-1d300e19b61d11e3a2321a098b7949f6c2058be2.tar.gz gcc-1d300e19b61d11e3a2321a098b7949f6c2058be2.tar.bz2 |
bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration.
* bitmap.c (bitmap_clear): Ensure `inline' is at the beginning
of the declaration.
* c-decl.c (finish_decl): Use parentheses around && within ||.
* rtl.c: Include stdlib.h.
(read_skip_spaces): Add parentheses around assignments used as
truth values.
(read_rtx): Initialize list_rtx.
* cppexp.c (parse_number): Use || when operands are truth values.
* alias.c (find_base_value): Add default case.
(memrefs_conflict): Likewise.
* combine.c (sets_function_arg_p): Likewise.
* genemit.c (gen_exp): Likewise.
* local-alloc.c (contains_replace_regs): Likewise.
* rtlanal.c (jmp_uses_reg_or_mem): Likewise.
* fold-const.c (fold_convert): Use "&&" for truth values.
(fold): Add default case.
* sdbout.c (sdbout_field_types): Fix typo in declaration.
(sdbout_one_type): Add default case.
* alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS.
(some_operand): Add default case.
(input_operand): Likewise.
(signed_comparison_operator): Likewise.
(divmod_operator): Likewise.
(alpha_set_memflags_1): Likewise.
* reload1.c (reload_cse_simplify_operands): Ensure function
always returns a value.
* scan-decls.c (scan_decls): Likewise.
* c-lex.c (skip_white_space): Fix typo in declaraion.
* c-typeck.c (comp_target_types): Add parentheses around assignment
used as truth value.
(print_spelling): Likewise.
(constructor_implicit, constructor_result): Remove unused variables.
* collect2.c (scan_library): Protect prototype with
#ifdef SCAN_LIBRARIES.
* emit-rtl.c (find_line_note): Fix typo in declaration.
* final.c (asm_insn_count): Protect prototype with
#ifdef HAVE_ATTR_length.
* flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC.
(try_pre_increment_1, try_pre_increment): Likewise.
* regclass.c (auto_inc_dec_reg_p): Protect prototype with
#ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit.
* gcov-io.h (__store_long, __write_long, __read_long): Fix
unsigned/signed comparisons.
* gcov.c (read_files): Remove unused "first_type" variable.
(scan _for_source_files): Initialize s_ptr.
(function_summary): Eliminate "%lf" formatting, use %ld for
longs.
(output_data): Initialize branch_probs and last_line_num.
Eliminate "%lf" formatting, use "%ld" for longs.
Co-Authored-By: Jeffrey A Law <law@cygnus.com>
From-SVN: r17158
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r-- | gcc/cppexp.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c index e4a0dcd..0a68df4 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -28,13 +28,17 @@ Written by Per Bothner 1994. */ #include "cpplib.h" extern char *xmalloc PARAMS ((unsigned)); -extern char *xrealloc PARAMS ((char *, unsigned)); +extern char *xrealloc PARAMS ((void *, unsigned)); #ifdef MULTIBYTE_CHARS #include <stdlib.h> #include <locale.h> #endif +#if HAVE_LIMITS_H +# include <limits.h> +#endif + #include <stdio.h> /* This is used for communicating lists of keywords with cccp.c. */ @@ -126,16 +130,34 @@ static long right_shift (); #define SKIP_OPERAND 8 /*#define UNSIGNEDP 16*/ -#ifndef HOST_BITS_PER_WIDE_INT +/* Find the largest host integer type and set its size and type. + Watch out: on some crazy hosts `long' is shorter than `int'. */ + +#ifndef HOST_WIDE_INT +# if HAVE_INTTYPES_H +# include <inttypes.h> +# define HOST_WIDE_INT intmax_t +# else +# if (HOST_BITS_PER_LONG <= HOST_BITS_PER_INT \ + && HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_INT) +# define HOST_WIDE_INT int +# else +# if (HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_LONG \ + || ! (defined LONG_LONG_MAX || defined LLONG_MAX)) +# define HOST_WIDE_INT long +# else +# define HOST_WIDE_INT long long +# endif +# endif +# endif +#endif -#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 +#ifndef CHAR_BIT +#define CHAR_BIT 8 #endif +#ifndef HOST_BITS_PER_WIDE_INT +#define HOST_BITS_PER_WIDE_INT (CHAR_BIT * sizeof (HOST_WIDE_INT)) #endif struct operation { @@ -226,7 +248,7 @@ parse_number (pfile, start, olen) if (largest_digit < digit) largest_digit = digit; nd = n * base + digit; - overflow |= ULONG_MAX_over_base < n | nd < n; + overflow |= ULONG_MAX_over_base < n || nd < n; n = nd; } @@ -367,7 +389,7 @@ cpp_lex (pfile, skip_evaluation) { if (c == '\\') { - c = cpp_parse_escape (pfile, &ptr); + c = cpp_parse_escape (pfile, (char **) &ptr); if (width < HOST_BITS_PER_INT && (unsigned) c >= (1 << width)) cpp_pedwarn (pfile, @@ -406,7 +428,7 @@ cpp_lex (pfile, skip_evaluation) { int num_bits = num_chars * width; - if (cpp_lookup (pfile, "__CHAR_UNSIGNED__", + if (cpp_lookup (pfile, (U_CHAR *)"__CHAR_UNSIGNED__", sizeof ("__CHAR_UNSIGNED__")-1, -1) || ((result >> (num_bits - 1)) & 1) == 0) op.value |