Branch: Tag:

2018-11-04

2018-11-04 12:47:39 by Tobias S. Josefowitz <tobij@tobij.de>

Interpreter: Advertise intended fallthrough cases

GCC >= 7 started being a bit verbose about this. Unfortunately from
inside macros our only option pretty much seems to be
__attribute__((fallthrough));, which we may not want to expose to other
compilers, hence using ADVERTISE_FALLTHROUGH macro.

For the general case, it seems to be the better option to stick with
/* FALLTHRU */ comments which GCC will also accept.

272:   OPCODE1_TAIL(F_MARK_AND_STRING, "mark & string", I_UPDATE_SP|I_UPDATE_M_SP, {    *(Pike_mark_sp++)=Pike_sp;    +  ADVERTISE_FALLTHROUGH;    OPCODE1(F_STRING, "string", I_UPDATE_SP, {    ref_push_string(Pike_fp->context->prog->strings[arg1]);    print_return_value();
346:   OPCODE1_TAIL(F_MARK_AND_GLOBAL, "mark & global", I_UPDATE_SP|I_UPDATE_M_SP, {    *(Pike_mark_sp++)=Pike_sp;    +  ADVERTISE_FALLTHROUGH;    OPCODE1(F_GLOBAL, "global", I_UPDATE_SP, {    low_index_current_object_no_free(Pike_sp, arg1);    Pike_sp++;
470:   OPCODE2_TAIL(F_MARK_AND_EXTERNAL, "mark & external", I_UPDATE_SP|I_UPDATE_M_SP, {    *(Pike_mark_sp++)=Pike_sp;    +  ADVERTISE_FALLTHROUGH;    OPCODE2(F_EXTERNAL,"external", I_UPDATE_SP, {    struct external_variable_context loc;   
1256:      /* This opcode is only used when running with -d. Identical to F_MARK,    * but with a different name to make the debug printouts more clear. */ +  ADVERTISE_FALLTHROUGH;    OPCODE0_TAIL(F_SYNCH_MARK, "synch mark", I_UPDATE_M_SP, {       OPCODE0(F_MARK, "mark", I_UPDATE_M_SP, {