summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-30 23:53:39 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-03 14:47:05 +0200
commit34b3bd896ec9b9e4ba298953fc504600dfdc7bff (patch)
treeb87da5fcd08dd09a9256be9d6a401ba855031b13
parent017eb132a6f47b4af3d8d1592e56c0272f311c91 (diff)
hurd_types: Add const_string_t typedde
This will allow to relieve constraints in callers, e.g. dir_lookup("") would otherwise produce a warning with gcc-11 since char[1024] would mean that dir_lookup would read all 1024 characters while it is not. * hurd/hurd_types.h (const_string_t): New type.
-rw-r--r--hurd/hurd_types.h1
-rw-r--r--libports/complete-deallocate.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/hurd/hurd_types.h b/hurd/hurd_types.h
index 288dcc2fc..f0521191e 100644
--- a/hurd/hurd_types.h
+++ b/hurd/hurd_types.h
@@ -61,6 +61,7 @@ typedef mach_port_t shutdown_t;
typedef char *data_t;
typedef const char *const_data_t;
typedef char string_t [1024];
+typedef const char *const_string_t;
typedef int *intarray_t;
typedef const int *const_intarray_t;
typedef int *fd_mask_t;
diff --git a/libports/complete-deallocate.c b/libports/complete-deallocate.c
index 5c548a37b..fccd59e4c 100644
--- a/libports/complete-deallocate.c
+++ b/libports/complete-deallocate.c
@@ -38,6 +38,7 @@ _ports_complete_deallocate (struct port_info *pi)
/* A reference was reacquired through a hash table lookup.
It's fine, we didn't touch anything yet. */
/* XXX: This really shouldn't happen. */
+ /* XXX: this did happen... */
assert_backtrace (! "reacquired reference w/o send rights");
pthread_rwlock_unlock (&_ports_htable_lock);
return;