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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 12:05:50 PDT 2021


On Mon, Oct 25, 2021 at 11:56 AM Sterling Augustine <saugustine at google.com>
wrote:

> 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.
>

Oh, sorry, didn't mean to suggest removing the function call, only the
unused variable.

But, sure, maybe some added testing would be useful (though I'd guess it's
tested elsewhere & isn't as relevant to the fuzz testing routine) - Added
Matt Morehouse the original reviewer (couldn't find a contact point for the
original author): Matt, could you check whether this would benefit from
more testing, otherwise remove the unused variable?

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/454aa9aa/attachment.html>


More information about the llvm-commits mailing list