mgorny added inline comments.
================ Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp:762 +static void fill_clamp(T &dest, U src, typename T::value_type fallback) { + dest = src <= std::numeric_limits<typename T::value_type>::max() ? src + : fallback; ---------------- shafik wrote: > I am building on a macOS and I seeing the following diagnostic for this line: > > ``` > warning: comparison of integers of different signs: 'int' and > 'std::numeric_limits<unsigned int>::type' (aka 'unsigned int') > [-Wsign-compare] > dest = src <= std::numeric_limits<typename T::value_type>::max() ? src > ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ``` > > and it is triggered by: > > ``` > fill_clamp(data.gdb_st_dev, file_stats.st_dev, 0); > ``` > > In this case it will do the right thing but allowing mixed types is > problematic, usually I see clamp done with homogeneous types. Could you suggest how to fix it? Some platforms have different signedness than the GDB struct type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107840/new/ https://reviews.llvm.org/D107840 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits