On 09/24/2015 01:53 PM, Mark Wielaard wrote:
Even if there are such constructs in header files and they aren't
actually bugs or people are unwilling to fix the issue with something
that is more idiomatic C then there are various ways to suppress the
warning. Either just don't use -Wunused-variable or add
-Wno-unused-const-variable. Add an explicit __attribute__((used)) or
just add a #pragma GCC system_header to the .h file.

If we are concerned that this generates warnings that aren't easy to
avoid then we might want to add that particular check behind -Wextra.
But is that really necessary? I am not against implementing an extra
warning exception/flag if it really is necessary. But it does introduce
more complexity and makes the warning less consistent. So what would be
a good way to find out one way or another whether the extra complexity
is needed?

I think at this point we have reports of just two packages generating extra warnings, with the warnings at least justifiable in both cases. So my vote would be to leave things as-is for now and see if more reports come in. It is after all expected that a new warning option generates new warnings.


Bernd

Reply via email to