Silence warning in select.cc
authorRupert Swarbrick <rswarbrick@gmail.com>
Wed, 27 May 2020 08:33:49 +0000 (09:33 +0100)
committerRupert Swarbrick <rswarbrick@gmail.com>
Wed, 27 May 2020 08:34:15 +0000 (09:34 +0100)
commit0d9beb5b2eec3ba839faa58a1a775311d9c3376c
tree8d927a947f50a04d27c114550b78b623707a6c8c
parenta7f2ef6d34c4b336a910b3c6f3d2cc11da8a82b4
Silence warning in select.cc

With GCC 9.3, at least, compiling select.cc spits out a warning about
an implausible bound being passed to strncmp. This comes from inlining
IdString::compare(): it turns out that passing std::string::npos as a
bound to strncmp triggers it.

This patch replaces the compare call with a memcmp with the same
effect. The repeated calls to IdString::c_str are slightly
inefficient, but I'll address that in a follow-up commit.
passes/cmds/select.cc