Message ID | CANeU7QnM-sns1pOgjpOrKp2LkMnf7O=89XSvF7hCuzvrwg5bPw@mail.gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
On 09/27/14 at 08:24am, Christopher Li wrote: > While I apply the patch, I notice this piece. Sparse has the on/off switch list. > "Werror" seems should belong to that list. Gcc accept "-Wno-error" to turn off > the switch. However, we might not want "-Wsparse-all" to turn on "Werror". > > So I have the incremental patch to convert "Werror" using the on/off > switch list. > > Feed back? Sure -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, Sep 27, 2014 at 3:11 PM, Thomas Graf <tgraf@suug.ch> wrote: >> Feed back? > > Sure Change pushed. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/lib.c b/lib.c index 5203d98..8395662 100644 --- a/lib.c +++ b/lib.c @@ -439,6 +439,7 @@ static const struct warning { { "designated-init", &Wdesignated_init }, { "do-while", &Wdo_while }, { "enum-mismatch", &Wenum_mismatch }, + { "error", &Werror }, { "init-cstring", &Winit_cstring }, { "non-pointer-null", &Wnon_pointer_null }, { "old-initializer", &Wold_initializer }, @@ -470,14 +471,11 @@ static char **handle_onoff_switch(char *arg, char **next, const struct warning if (!strcmp(p, "sparse-all")) { for (i = 0; i < n; i++) { - if (*warnings[i].flag != WARNING_FORCE_OFF) + if (*warnings[i].flag != WARNING_FORCE_OFF && warnings[i].flag != &Werror) *warnings[i].flag = WARNING_ON; } } - if (!strcmp(p, "error")) - Werror = 1; - // Prefixes "no" and "no-" mean to turn warning off.