This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Fixed enum constant in boolean context error
ClosedPublic

Authored by xbolva00 on Sep 3 2018, 11:26 AM.

Details

Summary

/home/xbolva00/LLVM/llvm/tools/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:656:59: warning: enum constant in boolean context [-Wint-in-bool-context]

if (mh.magic == llvm::MachO::MH_CIGAM || llvm::MachO::MH_MAGIC)
                                                      ^~~~~~~~

/home/xbolva00/LLVM/llvm/tools/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:658:62: warning: enum constant in boolean context [-Wint-in-bool-context]

if (mh.magic == llvm::MachO::MH_CIGAM_64 || llvm::MachO::MH_MAGIC_64)

Diff Detail

Repository
rLLDB LLDB

Event Timeline

xbolva00 created this revision.Sep 3 2018, 11:26 AM
teemperor accepted this revision.Sep 3 2018, 2:59 PM

This whole code doesn't seem to have test coverage, so I'll not demand a test for this. Also this patch is clearly fixing a typo, so let's get this in.

This revision is now accepted and ready to land.Sep 3 2018, 2:59 PM
xbolva00 closed this revision.Sep 3 2018, 3:10 PM

If you insert the text:

Differential Revision: https://reviews.llvm.org/D51600

Into your commit it will automatically show the SVN revision that was used for the commit. Can you attach the SVN revision to this as a comment so we can track this?

(you can also try arcanist which will do this automatically for you)

xbolva00 added a comment.EditedSep 4 2018, 9:06 AM

If you insert the text:

Differential Revision: https://reviews.llvm.org/D51600

Into your commit it will automatically show the SVN revision that was used for the commit. Can you attach the SVN revision to this as a comment so we can track this?

(you can also try arcanist which will do this automatically for you)

Ok, I will add it, thanks.

Btw, it is a bit strange, I used:
arc patch D51600
arc commit --revision D51600

Edit: Well, I see that lines in rL341340 and rLLDB341340 :)
Edit2: Ok, I see what you mean.

xbolva00 added a comment.EditedSep 4 2018, 9:17 AM

Ok, I probably messed up my LLDB svn a bit yesterday so yes, I have found the reason of that strange behavior :D Sorry, I will re-setup it locally. Thanks.