blob: 61932269bdce932cb3bd398ed22bbb5653c27ce3 [file] [log] [blame]
From 491b3b153f6b5cbf2d23a9778e5676eb29a6705f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 6 Feb 2023 16:37:19 -0800
Subject: [PATCH] Fix type of single bit bitfields
clang16 warns
trace.c:311:22: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
quash the warning by using an unsigned type to allow
an assignment of 0 or 1 without implicit conversion.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
library.h | 6 +++---
prototype.h | 2 +-
sysdeps/linux-gnu/trace.h | 10 +++++-----
3 files changed, 9 insertions(+), 9 deletions(-)
--- a/library.h
+++ b/library.h
@@ -71,20 +71,20 @@ struct library_symbol {
* looking up one in LIB->protolib. */
struct prototype *proto;
- int own_name : 1;
+ unsigned int own_name : 1;
/* This is relevant for PLT symbols. Latent PLT symbols are
* those that don't match any of the -e rules, but that might
* potentially become active if a library implementing them
* appears that matches a -l rule. Ltrace core is responsible
* for clearing latent flag. */
- int latent : 1;
+ unsigned latent : 1;
/* Delayed symbols are those for which a breakpoint shouldn't
* be enabled yet. They are similar to latent symbols, but
* backend is responsible for clearing the delayed flag. See
* proc_activate_delayed_symbol. */
- int delayed : 1;
+ unsigned int delayed : 1;
struct arch_library_symbol_data arch;
struct os_library_symbol_data os;
--- a/prototype.h
+++ b/prototype.h
@@ -162,7 +162,7 @@ struct protolib_cache {
/* For tracking uses of cache during cache's own
* initialization. */
- int bootstrap : 1;
+ unsigned int bootstrap : 1;
};
/* Initialize CACHE. Returns 0 on success or a negative value on
--- a/sysdeps/linux-gnu/trace.h
+++ b/sysdeps/linux-gnu/trace.h
@@ -33,11 +33,11 @@
struct pid_task {
pid_t pid; /* This may be 0 for tasks that exited
* mid-handling. */
- int sigstopped : 1;
- int got_event : 1;
- int delivered : 1;
- int vforked : 1;
- int sysret : 1;
+ unsigned int sigstopped : 1;
+ unsigned int got_event : 1;
+ unsigned int delivered : 1;
+ unsigned int vforked : 1;
+ unsigned int sysret : 1;
};
struct pid_set {
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -1043,7 +1043,7 @@ ltrace_exiting_install_handler(struct pr
struct process_vfork_handler
{
struct event_handler super;
- int vfork_bp_refd:1;
+ unsigned int vfork_bp_refd:1;
};
static Event *