Richard Biener <[email protected]> writes:
> On Sun, Feb 9, 2014 at 9:30 PM, Robert Dewar <[email protected]> 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.
OK, this version drops the "[enabled by default]" altogether.
Tested as before. OK to install?
Thanks,
Richard
gcc/
* opts.c (option_name): Remove "enabled by default" rider.
gcc/testsuite/
* gcc.dg/gomp/simd-clones-5.c: Update comment for new warning message.
Index: gcc/opts.c
===================================================================
--- gcc/opts.c 2014-02-10 20:36:32.380197329 +0000
+++ gcc/opts.c 2014-02-10 20:58:45.894502379 +0000
@@ -2216,14 +2216,10 @@ option_name (diagnostic_context *context
return xstrdup (cl_options[option_index].opt_text);
}
/* A warning without option classified as an error. */
- else if (orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN
- || diag_kind == DK_WARNING)
- {
- if (context->warning_as_error_requested)
- return xstrdup (cl_options[OPT_Werror].opt_text);
- else
- return xstrdup (_("enabled by default"));
- }
+ else if ((orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN
+ || diag_kind == DK_WARNING)
+ && context->warning_as_error_requested)
+ return xstrdup (cl_options[OPT_Werror].opt_text);
else
return NULL;
}
Index: gcc/testsuite/gcc.dg/gomp/simd-clones-5.c
===================================================================
--- gcc/testsuite/gcc.dg/gomp/simd-clones-5.c 2014-02-10 20:36:32.380197329
+0000
+++ gcc/testsuite/gcc.dg/gomp/simd-clones-5.c 2014-02-10 21:00:32.549412313
+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. */
#pragma omp declare simd notinbranch simdlen(4)
void foo (int *a)