[igt-dev] [Intel-gfx] [PATCH i-g-t] perf_pmu: Fix some compile warnings with old compilers / 32-bit builds

Chris Wilson chris at chris-wilson.co.uk
Mon Feb 19 10:12:57 UTC 2018


Quoting Tvrtko Ursulin (2018-02-19 10:04:08)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Correct printf format for uint64_t and one "may be uninitialized".
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Reported-by: Chris Wilson <chris at chris-wilson.co.uk>

Fixing those two turned up one more!

In file included from ./../lib/igt.h:40:0,
                 from perf_pmu.c:40:
perf_pmu.c: In function ‘__real_main1547’:
./../lib/igt_gt.h:111:2: warning: ‘render_fd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
perf_pmu.c:1761:7: note: ‘render_fd’ was declared here

This compiler is easily confused by longjmps

@@ -1758,7 +1758,7 @@ igt_main
         * Check render nodes are counted.
         */
        igt_subtest_group {
-               int render_fd;
+               int render_fd = -1;
 
Throw that in on top and have a 
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list