]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xdrgen: improve error reporting for invalid void declarations
authorKhushal Chitturi <kc9282016@gmail.com>
Tue, 18 Nov 2025 19:52:58 +0000 (01:22 +0530)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 26 Jan 2026 15:10:58 +0000 (10:10 -0500)
commit87a6e3b6c494ac519548c30b82b0d87b233b9649
tree1ea5606d8238b08685df9ce8183daabfbc0b039a
parent1f1fe81acbacdc8e0c5bf18ec2f69ca21a92edbc
xdrgen: improve error reporting for invalid void declarations

RFC 4506 defines void as a zero-length type that may appear only as
union arms or as program argument/result types. It cannot be declared
with an identifier, so constructs like "typedef void temp;" are not
valid XDR.

Previously, xdrgen raised a NotImplementedError when it encountered a
void declaration in a typedef. Which was misleading, as the problem is an
invalid RPC specification rather than missing functionality in xdrgen.

This patch replaces the NotImplementedError for _XdrVoid in typedef
handling with a clearer ValueError that specifies incorrect use of void
in the XDR input, making it clear that the issue lies in the RPC
specification being parsed.

Signed-off-by: Khushal Chitturi <kc9282016@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
tools/net/sunrpc/xdrgen/generators/typedef.py