[compiler-rt] r262342 - sanitizer_common: silence compiler warning

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 08:02:59 PST 2016


It was obvious when I looked at the source file: the variable is used
in a macro that can be expanded to nothing. Commit bot provided too
small context for the change. Sorry.



On Tue, Mar 1, 2016 at 4:53 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Might be useful to explain in the comment why the variable is there?
>
> On Mar 1, 2016 7:41 AM, "Dmitry Vyukov via llvm-commits"
> <llvm-commits at lists.llvm.org> wrote:
>>
>> Author: dvyukov
>> Date: Tue Mar  1 09:36:42 2016
>> New Revision: 262342
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=262342&view=rev
>> Log:
>> sanitizer_common: silence compiler warning
>>
>>
>> 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=262342&r1=262341&r2=262342&view=diff
>>
>> ==============================================================================
>> ---
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
>> (original)
>> +++
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Tue
>> Mar  1 09:36:42 2016
>> @@ -5354,6 +5354,7 @@ INTERCEPTOR(SSIZE_T, recvfrom, int fd, v
>>    COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
>>    SIZE_T srcaddr_sz;
>>    if (srcaddr) srcaddr_sz = *addrlen;
>> +  (void)srcaddr_sz;  // prevent "set but not used" warning
>>    SSIZE_T res = REAL(recvfrom)(fd, buf, len, flags, srcaddr, addrlen);
>>    if (res > 0) {
>>      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, res);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list