[Xcb] [PATCH] c_client.py: Always initialize xcb_align_to

Daniel Martin consume.noise at gmail.com
Tue Aug 13 04:51:05 PDT 2013


On 13 August 2013 00:05, Peter Harris <pharris at opentext.com> wrote:
> 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.

Can I take this as an Signed-off-by?


More information about the Xcb mailing list