[Mesa-dev] [PATCH 2/2] i965: fix unused var warnings in release build

Jordan Justen jordan.l.justen at intel.com
Wed Oct 25 05:59:15 UTC 2017


On 2017-10-24 21:15:45, Matt Turner wrote:
> I would suggest just marking the devinfo variables as UNUSED.

Or, MAYBE_UNUSED? :)

I considered that suggestion, since you recently suggested it to me. I
noticed that in all but one case the local variable was only
referenced 1 time, by the assert. There was one case where two asserts
used the variable. Therefore, removing the variable seemed reasonable.

Tim, You can keep my r-b if you decide to make use of *UNUSED.

> I really wish we didn't have to deal with this triviality :(

It does seem like someone would have a trick. I'm guessing they've all
been ruled out, such as: https://stackoverflow.com/a/985807

gcc probably will have figured out that the variable is not actually
read, so consider it unreferenced. :)

Or, maybe that trick would still cause a potential call to something
with side effects? (Which would probably be a bug anyway.)

-Jordan


More information about the mesa-dev mailing list