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

Peter Harris pharris at opentext.com
Tue Aug 13 06:55:47 PDT 2013


On 2013-08-13 07:51, Daniel Martin wrote:
> 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?

You can take it as a

Reviewed-by: Peter Harris <pharris at opentext.com>

(Signed-off-by means something else. See
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n304
"Developer's Certificate of Origin")

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