Message ID | 87eh3c3vl1.fsf@talisman.default |
---|---|
State | New |
Headers | show |
On 2/9/2014 3:00 PM, Richard Sandiford wrote: > We print "[-Wfoo]" after a warning that was enabled by the -Wfoo option, > which is pretty clear. But for warnings that have no -W option we just > print "[enabled by default]", which leads to the question of _what_ is > enabled by default. As shown by: > > http://gcc.gnu.org/ml/gcc/2014-01/msg00234.html > > it invites the wrong interpretation for things like: > > warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] > > IMO the natural assumption is that gnu++11 is enabled by default, which is > how Lars also read it. > > There seemed to be support for using "warning enabled by default" instead, > so this patch does that. Tested on x86_64-linux-gnu. OK to install? Sounds like an earthquake patch from the point of view of test suite baselines! > > I'll post an Ada patch separately. Will definitely have a big impact on the Ada test suite. Fine to post the Ada patch (which is of course trivial as a patch), but we will have to coordinate installing it with a pass through test base lines.
> IMO the natural assumption is that gnu++11 is enabled by default, which is > how Lars also read it. > > There seemed to be support for using "warning enabled by default" instead, > so this patch does that. Tested on x86_64-linux-gnu. OK to install? > > I'll post an Ada patch separately. FWIW this doesn't seem desirable to me, this will make the diagnostic longer. For Ada this wouldn't really disambiguate things, and some users may be dependent on the current format, so changing it isn't very friendly. Arno
On 2/9/2014 3:09 PM, Arnaud Charlet wrote: >> IMO the natural assumption is that gnu++11 is enabled by default, which is >> how Lars also read it. >> >> There seemed to be support for using "warning enabled by default" instead, >> so this patch does that. Tested on x86_64-linux-gnu. OK to install? >> >> I'll post an Ada patch separately. > > FWIW this doesn't seem desirable to me, this will make the diagnostic longer. > For Ada this wouldn't really disambiguate things, and some users may be > dependent on the current format, so changing it isn't very friendly. > > Arno can't we just reword the one warning where there is an ambiguity to avoid the confusion, rather than creating such an earthquake, which as Arno says, really has zero advantages to Ada programmers, and clear disadvantages .. to me [enabled by default] is already awfully long!
Robert Dewar <dewar@adacore.com> writes: > On 2/9/2014 3:09 PM, Arnaud Charlet wrote: >>> IMO the natural assumption is that gnu++11 is enabled by default, which is >>> how Lars also read it. >>> >>> There seemed to be support for using "warning enabled by default" instead, >>> so this patch does that. Tested on x86_64-linux-gnu. OK to install? >>> >>> I'll post an Ada patch separately. >> >> FWIW this doesn't seem desirable to me, this will make the diagnostic longer. >> For Ada this wouldn't really disambiguate things, and some users may be >> dependent on the current format, so changing it isn't very friendly. >> >> Arno > > can't we just reword the one warning where there is an ambiguity to > avoid the confusion, rather than creating such an earthquake, which > as Arno says, really has zero advantages to Ada programmers, and clear > disadvantages .. to me [enabled by default] is already awfully long! Well, since the Ada part has been rejected I think we just need to consider this from the non-Ada perspective. And IMO there's zero chance that each new warning will be audited for whether the "[enabled by default]" will be unambiguous. The fact that this particular warning caused confusion and someone actually reported it doesn't mean that there are no other warnings like that. E.g.: -fprefetch-loop-arrays is not supported with -Os [enabled by default] could also be misunderstood, especially if working on an existing codebase with an existing makefile. And the effect for: pragma simd ignored because -fcilkplus is not enabled [enabled by default] is a bit unfortunate. Those were just two examples -- I'm sure I could pick more. Thanks, Richard
On 2/9/2014 3:23 PM, Richard Sandiford wrote: >> can't we just reword the one warning where there is an ambiguity to >> avoid the confusion, rather than creating such an earthquake, which >> as Arno says, really has zero advantages to Ada programmers, and clear >> disadvantages .. to me [enabled by default] is already awfully long! > > Well, since the Ada part has been rejected I think we just need to > consider this from the non-Ada perspective. And IMO there's zero > chance that each new warning will be audited for whether the > "[enabled by default]" will be unambiguous. The fact that this > particular warning caused confusion and someone actually reported > it doesn't mean that there are no other warnings like that. E.g.: > > -fprefetch-loop-arrays is not supported with -Os [enabled by default] > > could also be misunderstood, especially if working on an existing codebase > with an existing makefile. And the effect for: > > pragma simd ignored because -fcilkplus is not enabled [enabled by default] > > is a bit unfortunate. Those were just two examples -- I'm sure I could > pick more. Indeed, worrisome examples, a shorter substitute would be [default warning] ??? > > Thanks, > Richard >
On Sun, Feb 9, 2014 at 9:30 PM, Robert Dewar <dewar@adacore.com> wrote: > On 2/9/2014 3:23 PM, Richard Sandiford wrote: > >>> can't we just reword the one warning where there is an ambiguity to >>> avoid the confusion, rather than creating such an earthquake, which >>> as Arno says, really has zero advantages to Ada programmers, and clear >>> disadvantages .. to me [enabled by default] is already awfully long! >> >> >> Well, since the Ada part has been rejected I think we just need to >> consider this from the non-Ada perspective. And IMO there's zero >> chance that each new warning will be audited for whether the >> "[enabled by default]" will be unambiguous. The fact that this >> particular warning caused confusion and someone actually reported >> it doesn't mean that there are no other warnings like that. E.g.: >> >> -fprefetch-loop-arrays is not supported with -Os [enabled by default] >> >> could also be misunderstood, especially if working on an existing codebase >> with an existing makefile. And the effect for: >> >> pragma simd ignored because -fcilkplus is not enabled [enabled by >> default] >> >> is a bit unfortunate. Those were just two examples -- I'm sure I could >> pick more. > > > Indeed, worrisome examples, > > a shorter substitute would be [default warning] > > ??? Or print nothing at all? After all [...] was supposed to tell people how to disable the warning! If there isn't a way to do that ... maybe instead print [-w]? hmm, all existing [...] are positive so we'd have to print -no-w which doesn't exist. Bah. So there isn't a way to "negate" -w on the commandline to only get default warnings enabled again. Richard. >> >> >> Thanks, >> Richard >> >
On 02/09/2014 09:00 PM, Richard Sandiford wrote:
> + return xstrdup (_("warning enabled by default"));
I think this is still wrong because this message really means, "this
warning cannot be controlled with a warning flag, but it can likely be
switched off by other means". I don't think it's helpful.
In my opinion, it is better to make this message obsolete by introducing
the missing warning flags.
Index: gcc/opts.c =================================================================== --- gcc/opts.c 2014-02-09 12:07:06.237317560 +0000 +++ gcc/opts.c 2014-02-09 12:07:06.371318597 +0000 @@ -2222,7 +2222,7 @@ option_name (diagnostic_context *context if (context->warning_as_error_requested) return xstrdup (cl_options[OPT_Werror].opt_text); else - return xstrdup (_("enabled by default")); + return xstrdup (_("warning enabled by default")); } else return NULL; Index: gcc/testsuite/gcc.dg/gomp/simd-clones-5.c =================================================================== --- gcc/testsuite/gcc.dg/gomp/simd-clones-5.c 2014-02-09 12:07:06.237317560 +0000 +++ gcc/testsuite/gcc.dg/gomp/simd-clones-5.c 2014-02-09 12:07:06.371318597 +0000 @@ -3,7 +3,7 @@ /* ?? The -w above is to inhibit the following warning for now: a.c:2:6: warning: AVX vector argument without AVX enabled changes - the ABI [enabled by default]. */ + the ABI [warning enabled by default]. */ #pragma omp declare simd notinbranch simdlen(4) void foo (int *a)