aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-02-23 12:35:41 -0500
committerSimon Marchi <simon.marchi@efficios.com>2023-05-05 15:27:06 -0400
commitcaaf38247f0c5e9a7d20d5aaa4ece0b3482f65f9 (patch)
tree6a84a94cf4a7225cc5a582bdf470789ffa28e978
parent12e3f3bc6ec74eb50e04675f5bcf962482d3ff25 (diff)
downloadgdb-caaf38247f0c5e9a7d20d5aaa4ece0b3482f65f9.zip
gdb-caaf38247f0c5e9a7d20d5aaa4ece0b3482f65f9.tar.gz
gdb-caaf38247f0c5e9a7d20d5aaa4ece0b3482f65f9.tar.bz2
gdb: fix -Wsingle-bit-bitfield-constant-conversion warning in z80-tdep.c
When building with clang 16, I see: /home/smarchi/src/binutils-gdb/gdb/z80-tdep.c:338:32: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] info->prologue_type.load_args = 1; ^ ~ /home/smarchi/src/binutils-gdb/gdb/z80-tdep.c:345:36: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] info->prologue_type.critical = 1; ^ ~ /home/smarchi/src/binutils-gdb/gdb/z80-tdep.c:351:37: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] info->prologue_type.interrupt = 1; ^ ~ /home/smarchi/src/binutils-gdb/gdb/z80-tdep.c:367:36: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] info->prologue_type.fp_sdcc = 1; ^ ~ /home/smarchi/src/binutils-gdb/gdb/z80-tdep.c:375:35: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] info->prologue_type.fp_sdcc = 1; ^ ~ /home/smarchi/src/binutils-gdb/gdb/z80-tdep.c:380:35: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] info->prologue_type.fp_sdcc = 1; ^ ~ Fix that by using "unsigned int" as the bitfield's underlying type. (cherry picked from commit 07f285934886016ddd82cac99a3873e68b499d5c) Change-Id: I3550a0112f993865dc70b18f02ab11bb5012693d Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30423 Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/z80-tdep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index aa296c7..2af6198 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -98,11 +98,11 @@ struct z80_unwind_cache
struct
{
- int called:1; /* there is return address on stack */
- int load_args:1; /* prologues loads args using POPs */
- int fp_sdcc:1; /* prologue saves and adjusts frame pointer IX */
- int interrupt:1; /* __interrupt handler */
- int critical:1; /* __critical function */
+ unsigned int called : 1; /* there is return address on stack */
+ unsigned int load_args : 1; /* prologues loads args using POPs */
+ unsigned int fp_sdcc : 1; /* prologue saves and adjusts frame pointer IX */
+ unsigned int interrupt : 1; /* __interrupt handler */
+ unsigned int critical : 1; /* __critical function */
} prologue_type;
/* Table indicating the location of each and every register. */