[Lldb-commits] [lldb] 92b475f - [lldb] silence -Wsometimes-uninitialized warnings

Krasimir Georgiev via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 28 00:37:59 PDT 2021


Thank you David. I just initialized these variables as suggested by
the warnings, without considering this case.
MichaƂ, could you please double check this case?



On Mon, Sep 27, 2021 at 9:09 PM David Blaikie <dblaikie at gmail.com> wrote:

> Maybe this isn't the right fix - msbit and lsbit probably shouldn't be
> printed if to_integer returns false in the diagnostic on line 195. If that
> diagnostic didn't use the variables, then I don't think this'd warn?
>
> On Mon, Sep 27, 2021 at 12:38 AM Krasimir Georgiev via lldb-commits <
> lldb-commits at lists.llvm.org> wrote:
>
>>
>> Author: Krasimir Georgiev
>> Date: 2021-09-27T09:35:58+02:00
>> New Revision: 92b475f0b079e125c588b121dc50116ea5d6d9f2
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/92b475f0b079e125c588b121dc50116ea5d6d9f2
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/92b475f0b079e125c588b121dc50116ea5d6d9f2.diff
>>
>> LOG: [lldb] silence -Wsometimes-uninitialized warnings
>>
>> No functional changes intended.
>>
>> Silence warnings from
>>
>> https://github.com/llvm/llvm-project/commit/3a6ba3675177cb5e47dee325f300aced4cd864ed
>> .
>>
>> Added:
>>
>>
>> Modified:
>>     lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>>
>> Removed:
>>
>>
>>
>>
>> ################################################################################
>> diff  --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> index a3a9d963c2213..f6a2cdf309815 100644
>> --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> @@ -141,8 +141,8 @@ DynamicRegisterInfo::SetRegisterInfo(const
>> StructuredData::Dictionary &dict,
>>            std::string reg_name_str = matches[1].str();
>>            std::string msbit_str = matches[2].str();
>>            std::string lsbit_str = matches[3].str();
>> -          uint32_t msbit;
>> -          uint32_t lsbit;
>> +          uint32_t msbit = 0;
>> +          uint32_t lsbit = 0;
>>            if (llvm::to_integer(msbit_str, msbit) &&
>>                llvm::to_integer(lsbit_str, lsbit)) {
>>              if (msbit > lsbit) {
>>
>>
>>
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210928/d1a7e8c9/attachment.html>


More information about the lldb-commits mailing list