[Xcb] [PATCH] c_client.py: Always initialize xcb_align_to
Peter Harris
pharris at opentext.com
Mon Aug 12 15:05:19 PDT 2013
On 2013-08-12 17:46, Daniel Martin wrote:
> if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
> /* insert padding */
> xcb_pad = -xcb_block_len & (xcb_align_to - 1);
> ...
>
> Why doesn't it show up with -O2?
At -O2, the compiler optimizes "-variable_it_can_prove_is_zero &
any_expression_without_side_effects" to the constant "0", so it doesn't
read xcb_align_to, so it doesn't emit the warning for reading an
uninitialized value (because it doesn't).
I'm in favour of always initializing xcb_align_to.
Peter Harris
--
Open Text Connectivity Solutions Group
Peter Harris http://connectivity.opentext.com/
Research and Development Phone: +1 905 762 6001
pharris at opentext.com Toll Free: 1 877 359 4866
More information about the Xcb
mailing list