Branch: Tag:

2016-10-22

2016-10-22 13:33:27 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Build: Get gcc to complain less about several switches.

Recent gcc complains about switch statements on enums if not
all values are handled explicitly.

94:    case F_LOCAL:    case F_VERSION:    return 1; +  default: +  /* Inform gcc that we don't care about most values of the enum. */ +  break;    }    return 0;   }
151: Inside #if defined(PIKE_DEBUG)
   }    }    } +  +  default: +  /* Inform gcc that we don't care about most values of the enum. */ +  break;    }       if(d_flag<2) break;
569:    }   #endif /* PIKE_DEBUG */    -  switch(n->token) +  /* NB: Cast below is to get gcc to stop complaining about +  * USHRT_MAX not being in the enum. +  */ +  switch((int)n->token)    {    case USHRT_MAX:    Pike_fatal("Freeing node again!\n");
578:    case F_CONSTANT:    free_svalue(&(n->u.sval));    break; +  +  default: +  /* Inform gcc that we don't care about most values of the enum. */ +  break;    }       if (car_is_node(n)) {
2133:    SUBTYPEOF(CAR(n)->u.sval) == FUNCTION_BUILTIN &&    CAR(n)->u.sval.u.efun->function == f)    return &_CDR(n); +  default: +  /* Inform gcc that we don't care about most values of the enum. */ +  break;    }    return 0;   }
4889:   #endif    continue;    +  default: +  /* Inform gcc that we don't care about some values of the enum. */ +  break;    }    n->node_info |= OPT_OPTIMIZED;    n=n->parent;