Re: [PATCH 0/5] Remove a few hurdles of compiling with clang

Eli Zaretskii
2017-06-13T19:23:07Z

> Date: Tue, 13 Jun 2017 19:07:29 +0200
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Cc: Simon Marchi <simon.marchi@ericsson.com>, qiyaoltc@gmail.com,
> gdb-patches@sourceware.org
>
> > Does clang have the equivalent of "#pragma push"? If it does, we
> > could disable this warning only for clang and only for that code
> > snippet.
>
> That's indeed a solution, but I'd keep that for the cases where we can't
> find an elegant solution that pleases both GCC and Clang.

See, I don't consider the proposed solution to be elegant, because it
tweaks a perfectly valid code to placate a stupid compiler warning.
Someone at some point might rightfully ask why didn't we use
ALL_DEBUG_ADDRESS_REGISTERS instead, and might even reinstate the code
you are about to change. So I prefer to have a seemingly "ugly"
workaround, which nonetheless points out exactly which warning of what
compiler caused it. That way, at some future point, when clang
hopefully gets its act together, we could revisit the issue and see
that the workaround is no longer needed.