<blockquote>
<p>Is this entirely harmless again?</p>
</blockquote>
<p>Quite possibly; you'd need to review the Boost internal code to find out. But in any case, if there is an issue, it's in Boost that this needs to be fixed.</p>
<blockquote>
<p>Maybe I should just be configuring with --enable-suppress-external-warnings and ignoring all Boost warnings?</p>
</blockquote>
<p>Unless you feel like debugging Boost itself, yes.</p>
<blockquote>
<p>A signed integer shouldn't be compared to an unsigned integer though surely?</p>
</blockquote>
<p>There is nothing inherently wrong with it. It's an indication that the code could be written in a more obviously correct way likely, but it's perfectly reasonable to encounter this in bug-free code. For example when in the context this is executed, it's known that the signed integer is never negative.</p>

CC BY-SA 4.0
2022-07-27T19:00:15.063Z
Bitcoin Core just uses Boost for the unit tests right? It doesn't use Boost libraries for anything else? So even **if** there was a bug in Boost you'd be (relatively) relaxed about it as its just a unit test dependency rather than a dependency for the actual codebase being tested? Will turn on suppress external warnings from now on.
Michael Folkson
CC BY-SA 4.0
2022-07-27T19:03:37.120Z
It uses Boost libraries for several things, but the Boost **Test** library (which is the one under consideration here) is only used by the Bitcoin Core test code, indeed.
Pieter Wuille
CC BY-SA 4.0
2022-07-27T18:40:02.523Z
2022-07-27T18:46:19.287Z
2022-07-27T18:46:19.287Z
Pieter Wuille
<p>In a similar vein to this <a href="https://bitcoin.stackexchange.com/questions/114370/should-these-bitcoin-core-build-warnings-be-addressed-or-are-they-entirely-harml/">question</a> I got a new Boost warning when building a PR branch on MacOS.</p>
<pre><code>In file included from /usr/local/include/boost/test/test_tools.hpp:46:
/usr/local/include/boost/test/tools/old/impl.hpp:107:17: warning: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Wsign-compare]
    return left == right;
</code></pre>
<p>Is this entirely harmless again? Maybe I should just be configuring with <code>--enable-suppress-external-warnings</code> and ignoring all Boost warnings? A signed integer shouldn't be compared to an unsigned integer though surely?</p>

<bitcoin-core-development><compiling>
Is this other Boost warning harmless and should be ignored when building Bitcoin Core?
Michael Folkson
# Is this other Boost warning harmless and should be ignored when building Bitcoin Core?

(Asked by: username_0 on 2022-07-27)

In a similar vein to this question I got a new Boost warning when building a PR branch on MacOS.
In file included from /usr/local/include/boost/test/test_tools.hpp:46:
/usr/local/include/boost/test/tools/old/impl.hpp:107:17: warning: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Wsign-compare]
    return left == right;

Is this entirely harmless again? Maybe I should just be configuring with --enable-suppress-external-warnings and ignoring all Boost warnings? A signed integer shouldn't be compared to an unsigned integer though surely?

**Tags:** bitcoin-core-development, compiling


---

## 1 answers

### Answer by username_1 on 2022-07-27. Score: 1 | Accepted answer

> Is this entirely harmless again?

Quite possibly; you'd need to review the Boost internal code to find out. But in any case, if there is an issue, it's in Boost that this needs to be fixed.

> Maybe I should just be configuring with --enable-suppress-external-warnings and ignoring all Boost warnings?

Unless you feel like debugging Boost itself, yes.

> A signed integer shouldn't be compared to an unsigned integer though surely?

There is nothing inherently wrong with it. It's an indication that the code could be written in a more obviously correct way likely, but it's perfectly reasonable to encounter this in bug-free code. For example when in the context this is executed, it's known that the signed integer is never negative.

> **Comments:**
> **username_0**: Bitcoin Core just uses Boost for the unit tests right? It doesn't use Boost libraries for anything else? So even **if** there was a bug in Boost you'd be (relatively) relaxed about it as its just a unit test dependency rather than a dependency for the actual codebase being tested? Will turn on suppress external warnings from now on.  
> **username_1**: It uses Boost libraries for several things, but the Boost **Test** library (which is the one under consideration here) is only used by the Bitcoin Core test code, indeed.  

---

