[Mesa-dev] dead code

Rob Clark robdclark at gmail.com
Wed Aug 3 18:48:18 UTC 2016


On Wed, Aug 3, 2016 at 2:18 PM, Enrico Weigelt, metux IT consult
<enrico.weigelt at gr13.net> wrote:
> On 03.08.2016 13:25, Rob Clark wrote:
>
>> Probably it would be on a case-by-case basis.  There are at least a
>> few places with some useful debug code, ie. not the kind that you'd
>> normally enable, but stuff you'd want if you were making changes in
>> those areas..
>
> In those cases, shouldn't we instead introduce proper #define's ?

At least in the cases I am thinking of, I'm not sure I really see the
value in that..  it isn't really stuff I'd ask a user to turn on.  (If
it came to that, I'd just ask the user to send me an apitrace so that
I could debug, and possibly change some #if 0 to #if 1, and/or add
other debug code in the process.)

There is a DEBUG define that is enabled for --enable-debug builds, but
most of the #if 0 debug code I've seen is stuff that is either too
much overhead, or too much printf spam for debug builds.

Anyways, I'm not saying there aren't some #if 0's that could be
removed.. some look relatively trivial and easy enough to recreate.
And/or useless.  I'm just saying we shouldn't blindly remove them all.

And I wouldn't be surprised if there were some '#ifdef SOMETHING's
that are actually worth removing.

BR,
-R


More information about the mesa-dev mailing list