[PATCH weston] window: avoid a gcc warning in buffer release handler

Pekka Paalanen ppaalanen at gmail.com
Wed May 22 22:42:04 PDT 2013


On Wed, 22 May 2013 12:36:27 -0700
Thiago Macieira <thiago.macieira at intel.com> wrote:

> On quarta-feira, 22 de maio de 2013 10.20.05, ppaalanen at gmail.com wrote:
> > Apparently some compilers complain about set but not used variables
> > 'available' and 'bufs', but I don't get the warning. Still, separate the
> > debugging code from shm_surface_buffer_release(), so that we only
> > compute 'bufs' when it is printed. This should fix the warnings
> 
> Set-but-unused is a new warning in GCC 4.7 and, as most warnings of its type, 
> sometimes it triggers only in release (optimised) mode. If you're building 
> with -O0 or an older GCC, you might not have seen it.

Indeed, I do both. Gcc 4.5 and almost always -O0, since I tend to need
to keep debugging stuff. ;-)

Thanks,
pq


More information about the wayland-devel mailing list