Re: [PATCH 26/40] Optimize .gdb_index symbol name searching

Pedro Alves
2017-11-20T00:33:45Z

On 11/18/2017 05:23 AM, Simon Marchi wrote:
> On 2017-06-02 08:22 AM, Pedro Alves wrote:

>> + /* In completion mode, increment the last character because
>> + we want UPPER to point past all symbols names that have
>> + the same prefix. */
>> + std::string after = cplus;
>> +
>> + gdb_assert (after.back () != 0xff);
>
> Hi Pedro,
>

Hi!

> With Clang, I get this warning:
>
> /home/simark/src/binutils-gdb/gdb/dwarf2read.c:4316:30: error: comparison of constant 255 with expression of type '__gnu_cxx::__alloc_traits<std::allocator<char> >::value_type' (aka 'char') is always true [-Werror,-Wtautological-constant-out-of-range-compare]
> gdb_assert (after.back () != 0xff);
> ~~~~~~~~~~~~~ ^ ~~~~
> /home/simark/src/binutils-gdb/gdb/common/gdb_assert.h:34:13: note: expanded from macro 'gdb_assert'
> ((void) ((expr) ? 0 : \
> ^~~~
>

Bleh, I should have known that'd come back and bite. :-P

I'm sending a 3 patch series in response to this email that fixes that,
and also other things that I ran into in course of fixing it.

Thanks,
Pedro Alves