[compiler-rt] 6b6564f - Fix unused variable warning.

Sterling Augustine via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 11:56:42 PDT 2021


The function call itself has side effects, so needs to be preserved. So one
could just remove the variable itself while preserving the function call, I
suppose, but the function does return a value and it seems like a better
test would actually check something about it.

On Mon, Oct 25, 2021 at 11:47 AM David Blaikie <dblaikie at gmail.com> wrote:

> Looks like this variable can be removed/is genuinely unused?
>
> On Wed, Oct 20, 2021 at 10:00 AM Sterling Augustine via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>>
>> Author: Sterling Augustine
>> Date: 2021-10-20T09:59:16-07:00
>> New Revision: 6b6564fcf9f5cce91630d1888d7e95b187bfc320
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/6b6564fcf9f5cce91630d1888d7e95b187bfc320
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/6b6564fcf9f5cce91630d1888d7e95b187bfc320.diff
>>
>> LOG: Fix unused variable warning.
>>
>> Added:
>>
>>
>> Modified:
>>     compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
>>
>> Removed:
>>
>>
>>
>>
>> ################################################################################
>> diff  --git a/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
>> b/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
>> index 1251a4e518ed0..7c6ecfb13687b 100644
>> --- a/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
>> +++ b/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
>> @@ -671,6 +671,7 @@ TEST(Corpus, Replace) {
>>                       /*TimeOfUnit*/ std::chrono::microseconds(5678),
>>                       /*FeatureSet*/ {}, DFT,
>>                       /*BaseII*/ nullptr);
>> +  (void) SecondII;
>>    Unit ReplacedU = Unit{0x03};
>>
>>    C->Replace(FirstII, ReplacedU,
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211025/5d54a1e1/attachment.html>


More information about the llvm-commits mailing list