]> arthur.barton.de Git - bup.git/commit
write_idx: fix handling of signed/unsigned values
authorRob Browning <rlb@defaultvalue.org>
Fri, 20 Nov 2020 07:29:02 +0000 (01:29 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 22 Nov 2020 20:42:01 +0000 (14:42 -0600)
commit5d153a347a2732fc117c655f842f019c5e52877c
treec9261ef689c5ff674bfe6c7fda933572cd6b6fd7
parent9c4acb514533925ccbfa6b5ceb88876fb36cb819
write_idx: fix handling of signed/unsigned values

Coerce the incoming Py_ssize_t count directly to the required uint32_t
while checking for overflow.  The underlying problem was identified
when we hit two sign-compare warnings on (32-bit) platforms where
ssize_t is 32 bits.

Explicitly add -Wsign-comapare to CFLAGS, just to be sure it's
included.

Reported-by: Dominique Leuenberger
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Makefile
lib/bup/_helpers.c