aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2024-06-11 20:47:56 +0100
committerNick Alcock <nick.alcock@oracle.com>2024-06-18 13:20:32 +0100
commit4bbc4b1f5cf650ace8b2aa683ccb24a34131ad3b (patch)
treef8179c67a73f3a287a7bddc2c982857327080481
parent6e09d4a6e6e62e585fe1237a0094f80f8aeef2fa (diff)
downloadbinutils-4bbc4b1f5cf650ace8b2aa683ccb24a34131ad3b.zip
binutils-4bbc4b1f5cf650ace8b2aa683ccb24a34131ad3b.tar.gz
binutils-4bbc4b1f5cf650ace8b2aa683ccb24a34131ad3b.tar.bz2
libctf: make the ctf_next ctn_fp non-const
This was always an error, because the ctn_fp routinely has errors set on it, which is not something you can (or should) do to a const object. libctf/ * ctf-impl.h (ctf_next_) <cu.ctn_fp>: Make non-const.
-rw-r--r--libctf/ctf-impl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/libctf/ctf-impl.h b/libctf/ctf-impl.h
index ec0b4fe..299d981 100644
--- a/libctf/ctf-impl.h
+++ b/libctf/ctf-impl.h
@@ -560,11 +560,13 @@ struct ctf_next
void **ctn_hash_slot;
} u;
- /* This union is of various sorts of dict we can iterate over:
- currently dictionaries and archives, dynhashes, and dynsets. */
+ /* This union is of various sorts of dict we can iterate over: currently
+ archives, dictionaries, dynhashes, and dynsets. ctn_fp is non-const
+ because we need to set errors on it. */
+
union
{
- const ctf_dict_t *ctn_fp;
+ ctf_dict_t *ctn_fp;
const ctf_archive_t *ctn_arc;
const ctf_dynhash_t *ctn_h;
const ctf_dynset_t *ctn_s;