[compiler-rt] r211008 - [asan] initialze varaibles to avoid a (false positive) report from gcc's -Wmaybe-uninitialized

Kostya Serebryany kcc at google.com
Mon Jun 16 08:14:26 PDT 2014


On Mon, Jun 16, 2014 at 6:56 PM, David Blaikie <dblaikie at gmail.com> wrote:

> Should we just disable gccs warning since clang has a better/more
> principled version anyway?
>
We may, but it will not help if someone is building sanitizers outside of
llvm build system(s), e.g. as part of GCC.



> On Jun 16, 2014 1:53 AM, "Kostya Serebryany" <kcc at google.com> wrote:
>
>> Author: kcc
>> Date: Mon Jun 16 03:32:02 2014
>> New Revision: 211008
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=211008&view=rev
>> Log:
>> [asan] initialze varaibles to avoid a (false positive) report from gcc's
>> -Wmaybe-uninitialized
>>
>> Modified:
>>
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
>>
>> Modified:
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=211008&r1=211007&r2=211008&view=diff
>>
>> ==============================================================================
>> ---
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
>> (original)
>> +++
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
>> Mon Jun 16 03:32:02 2014
>> @@ -1812,7 +1812,7 @@ INTERCEPTOR(int, getsockopt, int sockfd,
>>  INTERCEPTOR(int, accept, int fd, void *addr, unsigned *addrlen) {
>>    void *ctx;
>>    COMMON_INTERCEPTOR_ENTER(ctx, accept, fd, addr, addrlen);
>> -  unsigned addrlen0;
>> +  unsigned addrlen0 = 0;
>>    if (addrlen) {
>>      COMMON_INTERCEPTOR_READ_RANGE(ctx, addrlen, sizeof(*addrlen));
>>      addrlen0 = *addrlen;
>> @@ -1834,7 +1834,7 @@ INTERCEPTOR(int, accept, int fd, void *a
>>  INTERCEPTOR(int, accept4, int fd, void *addr, unsigned *addrlen, int f) {
>>    void *ctx;
>>    COMMON_INTERCEPTOR_ENTER(ctx, accept4, fd, addr, addrlen, f);
>> -  unsigned addrlen0;
>> +  unsigned addrlen0 = 0;
>>    if (addrlen) {
>>      COMMON_INTERCEPTOR_READ_RANGE(ctx, addrlen, sizeof(*addrlen));
>>      addrlen0 = *addrlen;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140616/428220e3/attachment.html>


More information about the llvm-commits mailing list