[BACK]Return to decl.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / xlint / lint1

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/xlint/lint1/decl.c between version 1.293 and 1.294

version 1.293, 2022/06/22 19:23:17 version 1.294, 2022/07/03 14:35:54
Line 1052  check_bit_field_type(sym_t *dsym, type_t
Line 1052  check_bit_field_type(sym_t *dsym, type_t
                 if (!bitfieldtype_ok) {                  if (!bitfieldtype_ok) {
                         /* TODO: Make this an error in C99 mode as well. */                          /* TODO: Make this an error in C99 mode as well. */
                         if (!allow_trad && !allow_c99) {                          if (!allow_trad && !allow_c99) {
                                   type_t *btp = block_dup_type(tp);
                                   btp->t_bitfield = false;
                                 /* bit-field type '%s' invalid in ANSI C */                                  /* bit-field type '%s' invalid in ANSI C */
                                 warning(273, type_name(tp));                                  warning(273, type_name(btp));
                         } else if (pflag) {                          } else if (pflag) {
                                   type_t *btp = block_dup_type(tp);
                                   btp->t_bitfield = false;
                                 /* nonportable bit-field type '%s' */                                  /* nonportable bit-field type '%s' */
                                 warning(34, type_name(tp));                                  warning(34, type_name(btp));
                         }                          }
                 }                  }
         } else if (t == INT && dcs->d_sign_mod == NOTSPEC) {          } else if (t == INT && dcs->d_sign_mod == NOTSPEC) {
Line 1067  check_bit_field_type(sym_t *dsym, type_t
Line 1071  check_bit_field_type(sym_t *dsym, type_t
         } else if (!(t == INT || t == UINT || t == BOOL ||          } else if (!(t == INT || t == UINT || t == BOOL ||
                      (is_integer(t) && (bitfieldtype_ok || allow_gcc)))) {                       (is_integer(t) && (bitfieldtype_ok || allow_gcc)))) {
   
                   type_t *btp = block_dup_type(tp);
                   btp->t_bitfield = false;
                 /* illegal bit-field type '%s' */                  /* illegal bit-field type '%s' */
                 warning(35, type_name(tp));                  warning(35, type_name(btp));
   
                 unsigned int sz = tp->t_flen;                  unsigned int sz = tp->t_flen;
                 dsym->s_type = tp = block_dup_type(gettyp(t = INT));                  dsym->s_type = tp = block_dup_type(gettyp(t = INT));

Legend:
Removed from v.1.293  
changed lines
  Added in v.1.294

CVSweb <webmaster@jp.NetBSD.org>