On Thu, Jun 15, 2017 at 1:20 AM, Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > > Please, drop what you have already pulled and take the > following instead. Here is the feed back for "finer control over error vs. warnings" +#define ERROR_CURR_PHASE (1 << 0) +#define ERROR_PREV_PHASE (1 << 1) +extern int has_error; The current phase vs previous phase define is a bit messy to maintain when you advance to next phase. Currently your patch does: + + if (has_error & ERROR_CURR_PHASE) + has_error = ERROR_PREV_PHASE; I purpose each different phase/stage we have a dedicate bits. #define PHASE_PARSING (1 << 0) #define PHASE_EVALUATE (1<<1) Have one variable to track which phase we are currently in, initialized to parsing. int current_phase = PHASE_PARSING; When move to evaluation: current_phase = PHASE_EVALUATE; The following code: - max_warnings = 0; + has_error |= ERROR_CURR_PHASE; will change to: has_error |= current_phase; Then you don't need to move bits between different phase: + + if (has_error & ERROR_CURR_PHASE) + has_error = ERROR_PREV_PHASE; That will be gone. The rest of the patch should be very similar. This has the advantage of: - The code clearly show which stage it is in. - No need to move error bits from current phase to previous phase. - more friendly if we have more than two phase. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html