This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Dynamic growable arrays for internal use


On 06/07/2017 04:41 PM, Stefan Liebler wrote:
> On 06/07/2017 11:40 AM, Florian Weimer wrote:
>> On 06/06/2017 05:30 PM, Stefan Liebler wrote:
>>> Hi Florian,
>>>
>>> I get the following warning / werror with gcc 4.8.5 on s390x:
>>> gcc tst-dynarray.c -O3 -c ... -o <build>/malloc/tst-dynarray.o
>>> In file included from tst-dynarray.c:50:0:
>>> tst-dynarray.c: In function ‘do_test’:
>>> ../support/check.h:51:8: error: ‘result.length’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>>       if (expr)                                                   \
>>>          ^
>>> tst-dynarray.c:377:23: note: ‘result.length’ was declared here
>>>       struct long_array result;
>>>                         ^
>>> In file included from tst-dynarray.c:50:0:
>>> ../support/check.h:51:8: error: ‘result.array’ may be used uninitialized
>>> in this function [-Werror=maybe-uninitialized]
>>>       if (expr)                                                   \
>>>          ^
>>> tst-dynarray.c:377:23: note: ‘result.array’ was declared here
>>>       struct long_array result;
>>>                         ^
>>> cc1: all warnings being treated as errors
>>>
>>>
>>> Have you seen those warnings on other architectures, too?
>>
>> I could reproduce it with -O3 on s390x.  I have not tried it with other
>> architectures, but it is a generic problem with TEST_VERIFY_EXIT which
>> is not really related to the dynarray code.  I propose the attached
>> patch to fix it.
>>
>> Thanks,
>> Florian
>>
> 
> This solves the warning with gcc 4.8.5 on s390x.

Okay, I'll check it in tomorrow unless there are objections/further
comments.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]