> a) I don't like the option name, -Womp-no-default-clause would be IMHO better
a bit related to b), I first had -Womp-no-default-none-clause but it becomes long and contains twice 'no' (also consider the no-omp-no-default... form). If you like that more, I'll make that change (see below) otherwise I retain the current form. > b) I think you shouldn't warn for explicit default(shared), or > default(firstprivate) or default(private) clauses, there user explicitly > tells what should happen for the non-listed vars (and it is pretty rare) I would still like to warn for those, default(shared) is equivalent to just leaving it out, and unfortunately, I have observed bugs with explicit default(shared/private). Usually caused by people updating code in large parallel sections, not realizing that they are in an OMP region. This is essentially what I would like to catch and to (effectively) enforce default(none). It is somewhat similar to the -fimplicit-none option in the Fortran FE. > c) in the documentation I think you should make it clear that it is just a > coding style warning (dunno if we have some verbiage for such warnings) Like so (and associated code/test changes) ? Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 215323) +++ gcc/common.opt (working copy) @@ -591,6 +591,10 @@ Wodr Common Var(warn_odr_violations) Init(1) Warning Warn about some C++ One Definition Rule violations during link time optimization +Womp-no-default-none-clause +Common Var(warn_omp_no_default_none_clause) Warning +Warn for error-prone code style in which an OMP parallel/task/teams construct has no explicit default(none) clause. + Woverflow Common Var(warn_overflow) Init(1) Warning Warn about overflow in arithmetic expressions