diff options
Diffstat (limited to 'lib9p')
-rw-r--r-- | lib9p/core_gen/c.py | 5 | ||||
-rw-r--r-- | lib9p/core_gen/c_unmarshal.py | 4 | ||||
-rw-r--r-- | lib9p/core_generated.c | 303 | ||||
-rw-r--r-- | lib9p/core_include/lib9p/core.h | 1 | ||||
-rw-r--r-- | lib9p/srv.c | 26 | ||||
-rw-r--r-- | lib9p/srv_include/lib9p/srv.h | 2 | ||||
-rw-r--r-- | lib9p/tests/test_compile.c | 2 | ||||
-rwxr-xr-x | lib9p/tests/test_compile.c.gen | 2 |
8 files changed, 171 insertions, 174 deletions
diff --git a/lib9p/core_gen/c.py b/lib9p/core_gen/c.py index b0ff871..393766b 100644 --- a/lib9p/core_gen/c.py +++ b/lib9p/core_gen/c.py @@ -23,7 +23,6 @@ def gen_c(versions: set[str], typs: list[idl.UserType]) -> str: ret = f"""/* Generated by `{' '.join(sys.argv)}`. DO NOT EDIT! */ -#include <stdbool.h> #include <stddef.h> /* for size_t */ #include <inttypes.h> /* for PRI* macros */ #include <string.h> /* for memset() */ @@ -36,9 +35,9 @@ def gen_c(versions: set[str], typs: list[idl.UserType]) -> str: #include "core_tables.h" #include "core_utf8.h" """ - # libobj vtables ########################################################### + # libmisc/obj.h vtables #################################################### ret += """ -/* libobj vtables *************************************************************/ +/* libmisc/obj.h vtables ******************************************************/ """ for typ in typs: ret += cutil.ifdef_push(1, c9util.ver_ifdef(typ.in_versions)) diff --git a/lib9p/core_gen/c_unmarshal.py b/lib9p/core_gen/c_unmarshal.py index 1afbe1d..206a85b 100644 --- a/lib9p/core_gen/c_unmarshal.py +++ b/lib9p/core_gen/c_unmarshal.py @@ -123,9 +123,9 @@ def gen_c_unmarshal(versions: set[str], typs: list[idl.UserType]) -> str: assert isinstance(typ, idl.Struct) ret += "\n" ret += cutil.ifdef_push(1, c9util.ver_ifdef(typ.in_versions)) - ret += f"static void unmarshal_{typ.typname}([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) {{\n" + ret += f"static void unmarshal_{typ.typname}([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) {{\n" ret += f"\t{c9util.typename(typ)} *out = out_buf;\n" - ret += "\t[[gnu::unused]] void *extra = &out[1];\n" + ret += "\t[[maybe_unused]] void *extra = &out[1];\n" ret += "\tuint32_t net_offset = 0;\n" indent_stack = [IndentLevel(ifdef=True)] diff --git a/lib9p/core_generated.c b/lib9p/core_generated.c index 1de7c67..2532d12 100644 --- a/lib9p/core_generated.c +++ b/lib9p/core_generated.c @@ -1,6 +1,5 @@ /* Generated by `lib9p/core.gen lib9p/idl/0000-uninitialized.9p lib9p/idl/2002-9P2000.9p lib9p/idl/2003-9P2000.p9p.9p lib9p/idl/2005-9P2000.u.9p lib9p/idl/2010-9P2000.L.9p lib9p/idl/2012-9P2000.e.9p`. DO NOT EDIT! */ -#include <stdbool.h> #include <stddef.h> /* for size_t */ #include <inttypes.h> /* for PRI* macros */ #include <string.h> /* for memset() */ @@ -13,7 +12,7 @@ #include "core_tables.h" #include "core_utf8.h" -/* libobj vtables *************************************************************/ +/* libmisc/obj.h vtables ******************************************************/ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_uninitialized LO_IMPLEMENTATION_C(fmt_formatter, lib9p_tag_t, lib9p_tag, static); LO_IMPLEMENTATION_C(fmt_formatter, lib9p_fid_t, lib9p_fid, static); @@ -1931,9 +1930,9 @@ static ssize_t validate_Rswrite(struct lib9p_ctx *ctx, uint32_t net_size, uint8_ net_offset += 8; #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -static void unmarshal_stat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_stat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_stat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 2; UNMARSHAL_U16LE(ctx, out->fstype); @@ -1966,9 +1965,9 @@ static void unmarshal_stat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_b #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_uninitialized -static void unmarshal_Tversion([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tversion([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tversion *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -1978,9 +1977,9 @@ static void unmarshal_Tversion([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_BYTES(ctx, out->version.utf8, out->version.len); } -static void unmarshal_Rversion([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rversion([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rversion *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -1992,9 +1991,9 @@ static void unmarshal_Rversion([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_uninitialized */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -static void unmarshal_Tauth([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tauth([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tauth *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2011,9 +2010,9 @@ static void unmarshal_Tauth([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ #endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ } -static void unmarshal_Rauth([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rauth([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rauth *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2023,9 +2022,9 @@ static void unmarshal_Rauth([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_U64LE(ctx, out->aqid.path); } -static void unmarshal_Tattach([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tattach([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tattach *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2043,9 +2042,9 @@ static void unmarshal_Tattach([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne #endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ } -static void unmarshal_Rattach([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rattach([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rattach *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2057,9 +2056,9 @@ static void unmarshal_Rattach([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_uninitialized -static void unmarshal_Rerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rerror([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rerror *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2075,9 +2074,9 @@ static void unmarshal_Rerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_uninitialized */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -static void unmarshal_Tflush([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tflush([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tflush *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2085,18 +2084,18 @@ static void unmarshal_Tflush([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U16LE(ctx, out->oldtag); } -static void unmarshal_Rflush([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rflush([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rflush *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Twalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Twalk([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Twalk *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2112,9 +2111,9 @@ static void unmarshal_Twalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ } } -static void unmarshal_Rwalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rwalk([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rwalk *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2131,9 +2130,9 @@ static void unmarshal_Rwalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -static void unmarshal_Topen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Topen([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Topen *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2142,9 +2141,9 @@ static void unmarshal_Topen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_U8LE(ctx, out->mode); } -static void unmarshal_Ropen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Ropen([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Ropen *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2155,9 +2154,9 @@ static void unmarshal_Ropen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_U32LE(ctx, out->iounit); } -static void unmarshal_Tcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tcreate([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tcreate *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2169,9 +2168,9 @@ static void unmarshal_Tcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_U8LE(ctx, out->mode); } -static void unmarshal_Rcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rcreate([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rcreate *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2184,9 +2183,9 @@ static void unmarshal_Rcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -static void unmarshal_Tread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tread([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tread *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2196,9 +2195,9 @@ static void unmarshal_Tread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_U32LE(ctx, out->count); } -static void unmarshal_Rread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rread([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rread *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2207,9 +2206,9 @@ static void unmarshal_Rread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_BYTES(ctx, out->data, out->count); } -static void unmarshal_Twrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Twrite([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Twrite *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2220,9 +2219,9 @@ static void unmarshal_Twrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_BYTES(ctx, out->data, out->count); } -static void unmarshal_Rwrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rwrite([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rwrite *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2230,9 +2229,9 @@ static void unmarshal_Rwrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->count); } -static void unmarshal_Tclunk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tclunk([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tclunk *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2240,18 +2239,18 @@ static void unmarshal_Tclunk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->fid); } -static void unmarshal_Rclunk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rclunk([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rclunk *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Tremove([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tremove([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tremove *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2259,9 +2258,9 @@ static void unmarshal_Tremove([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_U32LE(ctx, out->fid); } -static void unmarshal_Rremove([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rremove([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rremove *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2270,9 +2269,9 @@ static void unmarshal_Rremove([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -static void unmarshal_Tstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tstat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tstat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2280,9 +2279,9 @@ static void unmarshal_Tstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_U32LE(ctx, out->fid); } -static void unmarshal_Rstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rstat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rstat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2317,9 +2316,9 @@ static void unmarshal_Rstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ #endif /* CONFIG_9P_ENABLE_9P2000_u */ } -static void unmarshal_Twstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Twstat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Twstat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2355,9 +2354,9 @@ static void unmarshal_Twstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net #endif /* CONFIG_9P_ENABLE_9P2000_u */ } -static void unmarshal_Rwstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rwstat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rwstat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2366,9 +2365,9 @@ static void unmarshal_Rwstat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_p9p -static void unmarshal_Topenfd([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Topenfd([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Topenfd *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2377,9 +2376,9 @@ static void unmarshal_Topenfd([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_U8LE(ctx, out->mode); } -static void unmarshal_Ropenfd([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Ropenfd([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Ropenfd *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2393,9 +2392,9 @@ static void unmarshal_Ropenfd([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne #endif /* CONFIG_9P_ENABLE_9P2000_p9p */ #if CONFIG_9P_ENABLE_9P2000_L -static void unmarshal_Rlerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rlerror([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rlerror *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2403,9 +2402,9 @@ static void unmarshal_Rlerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_U32LE(ctx, out->errnum); } -static void unmarshal_Tstatfs([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tstatfs([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tstatfs *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2413,9 +2412,9 @@ static void unmarshal_Tstatfs([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_U32LE(ctx, out->fid); } -static void unmarshal_Rstatfs([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rstatfs([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rstatfs *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2431,9 +2430,9 @@ static void unmarshal_Rstatfs([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_U32LE(ctx, out->namelen); } -static void unmarshal_Tlopen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tlopen([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tlopen *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2442,9 +2441,9 @@ static void unmarshal_Tlopen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->flags); } -static void unmarshal_Rlopen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rlopen([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rlopen *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2455,9 +2454,9 @@ static void unmarshal_Rlopen([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->iounit); } -static void unmarshal_Tlcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tlcreate([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tlcreate *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2470,9 +2469,9 @@ static void unmarshal_Tlcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U32LE(ctx, out->gid); } -static void unmarshal_Rlcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rlcreate([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rlcreate *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2483,9 +2482,9 @@ static void unmarshal_Rlcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U32LE(ctx, out->iounit); } -static void unmarshal_Tsymlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tsymlink([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tsymlink *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2498,9 +2497,9 @@ static void unmarshal_Tsymlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U32LE(ctx, out->gid); } -static void unmarshal_Rsymlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rsymlink([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rsymlink *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2510,9 +2509,9 @@ static void unmarshal_Rsymlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U64LE(ctx, out->qid.path); } -static void unmarshal_Tmknod([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tmknod([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tmknod *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2526,9 +2525,9 @@ static void unmarshal_Tmknod([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->gid); } -static void unmarshal_Rmknod([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rmknod([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rmknod *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2538,9 +2537,9 @@ static void unmarshal_Rmknod([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U64LE(ctx, out->qid.path); } -static void unmarshal_Trename([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Trename([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Trename *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2551,18 +2550,18 @@ static void unmarshal_Trename([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_BYTES(ctx, out->name.utf8, out->name.len); } -static void unmarshal_Rrename([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rrename([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rrename *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Treadlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Treadlink([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Treadlink *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2570,9 +2569,9 @@ static void unmarshal_Treadlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t * UNMARSHAL_U32LE(ctx, out->fid); } -static void unmarshal_Rreadlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rreadlink([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rreadlink *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2581,9 +2580,9 @@ static void unmarshal_Rreadlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t * UNMARSHAL_BYTES(ctx, out->target.utf8, out->target.len); } -static void unmarshal_Tgetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tgetattr([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tgetattr *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2592,9 +2591,9 @@ static void unmarshal_Tgetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U64LE(ctx, out->request_mask); } -static void unmarshal_Rgetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rgetattr([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rgetattr *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2623,9 +2622,9 @@ static void unmarshal_Rgetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U64LE(ctx, out->data_version); } -static void unmarshal_Tsetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tsetattr([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tsetattr *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2642,18 +2641,18 @@ static void unmarshal_Tsetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U64LE(ctx, out->mtime_nsec); } -static void unmarshal_Rsetattr([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rsetattr([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rsetattr *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Txattrwalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Txattrwalk([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Txattrwalk *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2664,9 +2663,9 @@ static void unmarshal_Txattrwalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t UNMARSHAL_BYTES(ctx, out->name.utf8, out->name.len); } -static void unmarshal_Rxattrwalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rxattrwalk([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rxattrwalk *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2674,9 +2673,9 @@ static void unmarshal_Rxattrwalk([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t UNMARSHAL_U64LE(ctx, out->attr_size); } -static void unmarshal_Txattrcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Txattrcreate([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Txattrcreate *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2688,18 +2687,18 @@ static void unmarshal_Txattrcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_ UNMARSHAL_U32LE(ctx, out->flags); } -static void unmarshal_Rxattrcreate([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rxattrcreate([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rxattrcreate *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Treaddir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Treaddir([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Treaddir *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2709,9 +2708,9 @@ static void unmarshal_Treaddir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U32LE(ctx, out->count); } -static void unmarshal_Rreaddir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rreaddir([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rreaddir *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2720,9 +2719,9 @@ static void unmarshal_Rreaddir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_BYTES(ctx, out->data, out->count); } -static void unmarshal_Tfsync([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tfsync([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tfsync *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2731,18 +2730,18 @@ static void unmarshal_Tfsync([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->datasync); } -static void unmarshal_Rfsync([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rfsync([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rfsync *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Tlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tlock([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tlock *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2757,9 +2756,9 @@ static void unmarshal_Tlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_BYTES(ctx, out->client_id.utf8, out->client_id.len); } -static void unmarshal_Rlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rlock([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rlock *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2767,9 +2766,9 @@ static void unmarshal_Rlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_U8LE(ctx, out->status); } -static void unmarshal_Tgetlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tgetlock([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tgetlock *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2783,9 +2782,9 @@ static void unmarshal_Tgetlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_BYTES(ctx, out->client_id.utf8, out->client_id.len); } -static void unmarshal_Rgetlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rgetlock([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rgetlock *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2798,9 +2797,9 @@ static void unmarshal_Rgetlock([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_BYTES(ctx, out->client_id.utf8, out->client_id.len); } -static void unmarshal_Tlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tlink([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tlink *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2811,18 +2810,18 @@ static void unmarshal_Tlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ UNMARSHAL_BYTES(ctx, out->name.utf8, out->name.len); } -static void unmarshal_Rlink([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rlink([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rlink *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Tmkdir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tmkdir([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tmkdir *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2834,9 +2833,9 @@ static void unmarshal_Tmkdir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->gid); } -static void unmarshal_Rmkdir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rmkdir([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rmkdir *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2846,9 +2845,9 @@ static void unmarshal_Rmkdir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U64LE(ctx, out->qid.path); } -static void unmarshal_Trenameat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Trenameat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Trenameat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2861,18 +2860,18 @@ static void unmarshal_Trenameat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t * UNMARSHAL_BYTES(ctx, out->newname.utf8, out->newname.len); } -static void unmarshal_Rrenameat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rrenameat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rrenameat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Tunlinkat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tunlinkat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tunlinkat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2883,9 +2882,9 @@ static void unmarshal_Tunlinkat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t * UNMARSHAL_U32LE(ctx, out->flags); } -static void unmarshal_Runlinkat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Runlinkat([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Runlinkat *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2894,9 +2893,9 @@ static void unmarshal_Runlinkat([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t * #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000_e -static void unmarshal_Tsession([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tsession([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tsession *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2904,18 +2903,18 @@ static void unmarshal_Tsession([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n UNMARSHAL_U64LE(ctx, out->key); } -static void unmarshal_Rsession([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rsession([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rsession *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); } -static void unmarshal_Tsread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tsread([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tsread *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2930,9 +2929,9 @@ static void unmarshal_Tsread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net } } -static void unmarshal_Rsread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rsread([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rsread *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2941,9 +2940,9 @@ static void unmarshal_Rsread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_BYTES(ctx, out->data, out->count); } -static void unmarshal_Tswrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Tswrite([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Tswrite *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; @@ -2960,9 +2959,9 @@ static void unmarshal_Tswrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_BYTES(ctx, out->data, out->count); } -static void unmarshal_Rswrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { +static void unmarshal_Rswrite([[maybe_unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { struct lib9p_msg_Rswrite *out = out_buf; - [[gnu::unused]] void *extra = &out[1]; + [[maybe_unused]] void *extra = &out[1]; uint32_t net_offset = 0; net_offset += 4; net_offset += 1; diff --git a/lib9p/core_include/lib9p/core.h b/lib9p/core_include/lib9p/core.h index 549411f..aa470de 100644 --- a/lib9p/core_include/lib9p/core.h +++ b/lib9p/core_include/lib9p/core.h @@ -7,7 +7,6 @@ #ifndef _LIB9P_CORE_H_ #define _LIB9P_CORE_H_ -#include <stdbool.h> #include <sys/types.h> /* for ssize_t */ #include <libmisc/assert.h> diff --git a/lib9p/srv.c b/lib9p/srv.c index 6d9d992..12124af 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -54,12 +54,12 @@ void lib9p_srv_acknowledge_flush(struct lib9p_srv_ctx *ctx) { ctx->flush_acknowledged = true; } -#define req_debugf(fmt, ...) \ - debugf("cid=%zu: %s(tag=%"PRIu16"): " fmt, \ - cr_getcid(), \ - lib9p_msgtype_str(ctx->basectx.version, ctx->net_bytes[4]), \ - ctx->tag \ - __VA_OPT__(,) __VA_ARGS__) +#define req_debugf(fmt, ...) \ + log_debugf("cid=%zu: %s(tag=%"PRIu16"): " fmt, \ + cr_getcid(), \ + lib9p_msgtype_str(ctx->basectx.version, ctx->net_bytes[4]), \ + ctx->tag \ + __VA_OPT__(,) __VA_ARGS__) /* structs ********************************************************************/ @@ -176,7 +176,7 @@ static inline bool srv_check_perm(struct srv_req *ctx, struct lib9p_srv_stat *st return mode & action; } -[[gnu::unused]] +[[maybe_unused]] static struct lib9p_srv_userid *srv_userid_new(struct lib9p_s name #if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L , lib9p_nuid_t num @@ -361,7 +361,7 @@ static void srv_msglog(struct srv_req *req, enum lib9p_msg_type typ, void *hostm #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat" #pragma GCC diagnostic ignored "-Wformat-extra-args" - infof("%c %v", typ % 2 ? '<' : '>', lo_box_lib9p_msg_as_fmt_formatter(&req->basectx, typ, hostmsg)); + log_infof("%c %v", typ % 2 ? '<' : '>', lo_box_lib9p_msg_as_fmt_formatter(&req->basectx, typ, hostmsg)); #pragma GCC diagnostic pop } @@ -373,7 +373,7 @@ static ssize_t srv_write_Rmsg(struct srv_req *req, struct lib9p_Rmsg_send_buf *r return r; } -#define srv_nonrespond_errorf errorf +#define srv_nonrespond_errorf log_errorf static void srv_respond_error(struct srv_req *req) { #if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L @@ -707,10 +707,10 @@ static inline void _srv_respond(struct srv_req *ctx, enum lib9p_msg_type resp_ty /* handle_T* ******************************************************************/ -#define srv_handler_common(ctx, typ, req) \ - assert(ctx); \ - assert(req); \ - struct lib9p_msg_T##typ *_typecheck_req [[gnu::unused]] = req; \ +#define srv_handler_common(ctx, typ, req) \ + assert(ctx); \ + assert(req); \ + struct lib9p_msg_T##typ *_typecheck_req [[maybe_unused]] = req; \ struct lib9p_msg_R##typ resp = { .tag = ctx->tag } static void handle_Tversion(struct srv_req *ctx, diff --git a/lib9p/srv_include/lib9p/srv.h b/lib9p/srv_include/lib9p/srv.h index ca80e7b..c40c85a 100644 --- a/lib9p/srv_include/lib9p/srv.h +++ b/lib9p/srv_include/lib9p/srv.h @@ -12,8 +12,8 @@ #include <libcr_ipc/rpc.h> #include <libhw/generic/net.h> #include <libmisc/assert.h> +#include <libmisc/obj.h> #include <libmisc/private.h> -#include <libobj/obj.h> #include <lib9p/core.h> diff --git a/lib9p/tests/test_compile.c b/lib9p/tests/test_compile.c index e53b738..e814bf9 100644 --- a/lib9p/tests/test_compile.c +++ b/lib9p/tests/test_compile.c @@ -2,7 +2,7 @@ #include <lib9p/core.h> int main(void) { - [[gnu::unused]] uint64_t x; + [[maybe_unused]] uint64_t x; #ifdef LIB9P_B4_FALSE x = LIB9P_B4_FALSE; #endif diff --git a/lib9p/tests/test_compile.c.gen b/lib9p/tests/test_compile.c.gen index eb89c54..c57ce9f 100755 --- a/lib9p/tests/test_compile.c.gen +++ b/lib9p/tests/test_compile.c.gen @@ -12,7 +12,7 @@ outfile=$2 echo echo "#include <lib9p/core.h>" echo 'int main(void) {' - echo ' [[gnu::unused]] uint64_t x;' + echo ' [[maybe_unused]] uint64_t x;' <"$generated_h" sed -nE 's/^\s*#\s*define\s*(\S[^ (]*)\s.*/\1/p' | LC_COLLATE=C sort -u | sed 's/.*/#ifdef &\n x = &;\n#endif/' echo ' return 0;' echo '}' |