arbor-sim/arbor

int size, signedness mismatches

Closed this issue · 0 comments

In arbor/include/arbor/util/hash_def.h, the internal_hash function has two loops with a size_t bound but an int iterator:

for (int ix = 0; ix < sizeof(data); ++ix)

While it is hard to imagine triggering the limited range bug, it also gives us a signedness comparison warning.

In test/unit/test_probe.cpp there are two loops with an unsigned bound but an int iterator:

for (int ix = 0; ix < n_cv; ++ix) i_memb[ix] = *s_beg++;

Making ix an unsigned is sufficient here.