From: Jeremy Harris Date: Thu, 25 Apr 2019 09:26:46 +0000 (+0100) Subject: Use unsigned when creating bitmasks in macros X-Git-Tag: exim-4.93-RC0~227 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bd83c6f989cac6318ee32af3e34d3f5e69b27100;p=exim.git Use unsigned when creating bitmasks in macros --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index cf8c41a9f..2c57ce64b 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -77,6 +77,9 @@ HS/02 Bug 2392: exigrep does case sensitive *option* processing (as it did for all versions <4.90). Notably -M, -m, --invert, -I may be affected. +JH/15 Use unsigned when creating bitmasks in macros, to avoid build errors + on some platforms for bit 31. + Exim version 4.92 ----------------- diff --git a/src/src/macros.h b/src/src/macros.h index a1dd99901..f98d5e6bd 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -339,11 +339,11 @@ platforms, but this ensures bit vectors always work the same way. */ /* This macro is for single-word bit vectors: the debug selector, and the first word of the log selector. */ -#define BIT(n) (1 << (n)) +#define BIT(n) (1U << (n)) /* And these are for multi-word vectors. */ -#define BITWORD(n) ( (n) / BITWORDSIZE) -#define BITMASK(n) (1 << (n) % BITWORDSIZE) +#define BITWORD(n) ( (n) / BITWORDSIZE) +#define BITMASK(n) (1U << (n) % BITWORDSIZE) #define BIT_CLEAR(s,z,n) ((s)[BITWORD(n)] &= ~BITMASK(n)) #define BIT_SET(s,z,n) ((s)[BITWORD(n)] |= BITMASK(n)) @@ -378,12 +378,12 @@ enum { Di_local_scan = 1, Di_iota = IOTA_INIT(2), - DEBUG_BIT(acl), + DEBUG_BIT(acl), /* 2 */ DEBUG_BIT(auth), DEBUG_BIT(deliver), DEBUG_BIT(dns), DEBUG_BIT(dnsbl), - DEBUG_BIT(exec), + DEBUG_BIT(exec), /* 7 */ DEBUG_BIT(expand), DEBUG_BIT(filter), DEBUG_BIT(hints_lookup), @@ -391,7 +391,7 @@ enum { DEBUG_BIT(ident), DEBUG_BIT(interface), DEBUG_BIT(lists), - DEBUG_BIT(load), + DEBUG_BIT(load), /* 15 */ DEBUG_BIT(lookup), DEBUG_BIT(memory), DEBUG_BIT(noutf8), @@ -399,7 +399,7 @@ enum { DEBUG_BIT(process_info), DEBUG_BIT(queue_run), DEBUG_BIT(receive), - DEBUG_BIT(resolver), + DEBUG_BIT(resolver), /* 23 */ DEBUG_BIT(retry), DEBUG_BIT(rewrite), DEBUG_BIT(route), @@ -407,7 +407,7 @@ enum { DEBUG_BIT(tls), DEBUG_BIT(transport), DEBUG_BIT(uid), - DEBUG_BIT(verify), + DEBUG_BIT(verify), /* 31 */ }; /* Multi-bit debug masks */