On 12/08/2017 10:34 AM, Jakub Jelinek wrote:
On Fri, Dec 08, 2017 at 10:25:48AM -0700, Martin Sebor wrote:
While testing the patch I noticed it issues some diagnostics
multiple times. It would be nice if the last (redundant)
pedantic warning in the error case below could be avoided.
You mean completely drop the pedwarn "initialization of a flexible array member"
in all cases, because in theory we should have emitted already
"ISO C++ forbids flexible array member" pedwarn earlier?
I think it is better to pedwarn in both spots, the earlier pedwarn
might be disabled because of system headers or whatever else.
I agree.
Or do you just mean to pedwarn only if we are not emitting the
"initialization of flexible array member in a nested context" error?
That is going to be harder, as that error is emitted in a different spot
(actually 2, because the STRING_CST vs. brace enclosed initializer is
separate), unlike the pedwarn is complain & tf_error guarded, etc.
I meant the latter. It's no big deal if it's too hard. It's
just something I noticed and thought might be easy to handle.
Martin