mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
xdrgen: Do not declare union XDR functions in the definitions header
Unlike the struct, enum, typedef, and pointer templates, the union
definitions template also emits xdrgen_decode_*() and
xdrgen_encode_*() prototypes for a public union into that header.
Those prototypes name struct xdr_stream, which the definitions
header neither includes nor forward-declares, so any translation
unit that includes the definitions header without xdr.h already in
scope draws -Wvisibility warnings. The same public prototypes are
emitted into the declarations header, which does include
<linux/sunrpc/xdr.h>, making the definitions-header copies
redundant.
Drop the prototype emission from the union definitions template so
it matches the other type templates. Public unions keep their
encode and decode prototypes through the declarations header.
Fixes: 4b132aacb0 ("tools: Add xdrgen")
Link: https://patch.msgid.link/20260712193122.116845-4-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
parent
0cfead4c11
commit
d4ca0b0a6c
|
|
@ -1,9 +1,3 @@
|
|||
{# SPDX-License-Identifier: GPL-2.0 #}
|
||||
} u;
|
||||
};
|
||||
{%- if name in public_apis %}
|
||||
|
||||
|
||||
bool xdrgen_decode_{{ name }}(struct xdr_stream *xdr, struct {{ name }} *ptr);
|
||||
bool xdrgen_encode_{{ name }}(struct xdr_stream *xdr, const struct {{ name }} *ptr);
|
||||
{%- endif -%}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user