mirror of
https://github.com/cc65/cc65.git
synced 2025-01-31 03:33:04 +00:00
Fix MSVC build broken by #1058
MSVC complains about unary negation of unsigned, but it's intended. Suppress the warning. https://github.com/cc65/cc65/pull/1058#discussion_r451757967 "Tested" with godbolt.org.
This commit is contained in:
parent
359da1ae76
commit
9e5b8d99a3
@ -772,7 +772,11 @@ static SymEntry* ParseStructDecl (const char* Name)
|
|||||||
*/
|
*/
|
||||||
if (BitOffs > 0) {
|
if (BitOffs > 0) {
|
||||||
if (FieldWidth <= 0 || (BitOffs + FieldWidth) > INT_BITS) {
|
if (FieldWidth <= 0 || (BitOffs + FieldWidth) > INT_BITS) {
|
||||||
/* Bits needed to byte-align the next field. */
|
/* Bits needed to byte-align the next field. MSVC complains
|
||||||
|
** about unary negation of unsigned, but it's intended.
|
||||||
|
** Disable the warning for the next line only.
|
||||||
|
*/
|
||||||
|
#pragma warning(disable: 4146)
|
||||||
unsigned PaddingBits = -BitOffs % CHAR_BITS;
|
unsigned PaddingBits = -BitOffs % CHAR_BITS;
|
||||||
|
|
||||||
/* We need an anonymous name */
|
/* We need an anonymous name */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user