diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-02 21:41:37 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-02 21:41:37 +0000 |
commit | 0fd4500a3c09e76744f3d67174e092530c863a5f (patch) | |
tree | 8a00f5b43c598532f161eef6222794b0969e1a8b /gcc/c-format.c | |
parent | 5f98b192ff4e08e7033ef3b5db370623ed4ba113 (diff) | |
download | gcc-0fd4500a3c09e76744f3d67174e092530c863a5f.tar.gz |
* print-rtl.c (print_rtx): Cast enums to int for comparison.
* c-decl.c (grokdeclarator): Cast enums to int for comparison and
shifts.
* c-format.c (C_STD_VER): Cast to int for comparisons.
(check_function_format): Cast various enums to int for &.
(maybe_read_dollar_number): Likewise.
(check_format_info): Likewise.
(check_format_info_main): Likewise.
* expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison.
(safe_from_p): Likewise.
* varasm.c (const_hash): Cast enum to int for %.
* emit-rtl.c (init_emit_once): Use int loop variable to work around
pcc enum problems with < and ++ operators.
* regclass.c (init_reg_sets_1): Cast enums for comparison.
(choose_hard_reg_mode): Use unsigned int to iterate over CCmodes.
(regclass_init): Change enum class to int to iterate over reg_classes.
* genrecog.c (merge_trees): Cast enums for comparison.
* rtl.h (GET_CODE): Cast to enum rtx_code.
(PUT_CODE): Cast to ENUM_BITFIELD(rtx_code).
(GET_MODE): Cast to enum machine_mode.
(PUT_MODE): Cast to ENUM_BITFIELD(machine_mode).
(GET_NOTE_INSN_NAME): Cast enum to int.
* tree.h (TREE_CODE): Cast to enum tree_code.
(TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code).
* timevar.c (timevar_print): Change loop variable id from enum to
unsigned int.
* fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int.
* config/i386/i386.md: Use PUT_MODE for mode assignment.
* toplev.c (compile_file): Cast enum DFI to int.
(decode_d_option): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40193 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r-- | gcc/c-format.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c index 5adb8e53abd..b6270e2ae27 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -476,11 +476,11 @@ enum format_std_version or inheriting from, for the purpose of format features supported. */ #define CPLUSPLUS_STD_VER STD_C89 /* The C standard version we are checking formats against when pedantic. */ -#define C_STD_VER (c_language == clk_cplusplus \ +#define C_STD_VER ((int)(c_language == clk_cplusplus \ ? CPLUSPLUS_STD_VER \ : (flag_isoc99 \ ? STD_C99 \ - : (flag_isoc94 ? STD_C94 : STD_C89))) + : (flag_isoc94 ? STD_C94 : STD_C89)))) /* The name to give to the standard version we are warning about when pedantic. FEATURE_VER is the version in which the feature warned out appeared, which is higher than C_STD_VER. */ @@ -1105,7 +1105,8 @@ check_function_format (status, name, assembler_name, params) /* Yup; check it. */ check_format_info (status, info, params); if (warn_missing_format_attribute && info->first_arg_num == 0 - && (format_types[info->format_type].flags & FMT_FLAG_ARG_CONVERT)) + && (format_types[info->format_type].flags + & (int) FMT_FLAG_ARG_CONVERT)) { function_format_info *info2; for (info2 = function_format_list; info2; info2 = info2->next) @@ -1298,7 +1299,7 @@ maybe_read_dollar_number (status, format, dollar_needed, params, param_ptr, nalloc - dollar_arguments_alloc); dollar_arguments_alloc = nalloc; } - if (!(fki->flags & FMT_FLAG_DOLLAR_MULTIPLE) + if (!(fki->flags & (int) FMT_FLAG_DOLLAR_MULTIPLE) && dollar_arguments_used[argnum - 1] == 1) { dollar_arguments_used[argnum - 1] = 2; @@ -1434,7 +1435,7 @@ check_format_info (status, info, params) /* Functions taking a va_list normally pass a non-literal format string. These functions typically are declared with first_arg_num == 0, so avoid warning in those cases. */ - if (!(format_types[info->format_type].flags & FMT_FLAG_ARG_CONVERT)) + if (!(format_types[info->format_type].flags & (int) FMT_FLAG_ARG_CONVERT)) { /* For strftime-like formats, warn for not checking the format string; but there are no arguments to check. */ @@ -1746,7 +1747,7 @@ check_format_info_main (status, res, info, format_chars, format_length, } flag_chars[0] = 0; - if ((fki->flags & FMT_FLAG_USE_DOLLAR) && has_operand_number != 0) + if ((fki->flags & (int) FMT_FLAG_USE_DOLLAR) && has_operand_number != 0) { /* Possibly read a $ operand number at the start of the format. If one was previously used, one is required here. If one @@ -1867,7 +1868,7 @@ check_format_info_main (status, res, info, format_chars, format_length, ++format_chars; } if (found_width && !non_zero_width_char && - (fki->flags & FMT_FLAG_ZERO_WIDTH_BAD)) + (fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD)) status_warning (status, "zero width in %s format", fki->name); if (found_width) @@ -1954,7 +1955,7 @@ check_format_info_main (status, res, info, format_chars, format_length, } else { - if (!(fki->flags & FMT_FLAG_EMPTY_PREC_OK) + if (!(fki->flags & (int) FMT_FLAG_EMPTY_PREC_OK) && !ISDIGIT (*format_chars)) status_warning (status, "empty precision in %s format", fki->name); @@ -2025,7 +2026,7 @@ check_format_info_main (status, res, info, format_chars, format_length, } /* Handle the scanf allocation kludge. */ - if (fki->flags & FMT_FLAG_SCANF_A_KLUDGE) + if (fki->flags & (int) FMT_FLAG_SCANF_A_KLUDGE) { if (*format_chars == 'a' && !flag_isoc99) { @@ -2043,7 +2044,8 @@ check_format_info_main (status, res, info, format_chars, format_length, format_char = *format_chars; if (format_char == 0 - || (!(fki->flags & FMT_FLAG_FANCY_PERCENT_OK) && format_char == '%')) + || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK) + && format_char == '%')) { status_warning (status, "conversion lacks type at end of format"); continue; @@ -2109,7 +2111,7 @@ check_format_info_main (status, res, info, format_chars, format_length, flag_chars[i - d] = 0; } - if ((fki->flags & FMT_FLAG_SCANF_A_KLUDGE) + if ((fki->flags & (int) FMT_FLAG_SCANF_A_KLUDGE) && strchr (flag_chars, 'a') != 0) aflag = 1; @@ -2190,7 +2192,7 @@ check_format_info_main (status, res, info, format_chars, format_length, wanted_type = 0; wanted_type_name = 0; - if (fki->flags & FMT_FLAG_ARG_CONVERT) + if (fki->flags & (int) FMT_FLAG_ARG_CONVERT) { wanted_type = (fci->types[length_chars_val].type ? *fci->types[length_chars_val].type : 0); |