Thread (37 messages) 37 messages, 9 authors, 2018-10-09
STALE2847d

[PATCH 02/11] UAPI: keys: Fix use of C++ keywords as structural members

From: David Howells <dhowells@redhat.com>
Date: 2018-09-05 15:54:53
Also in: keyrings, linux-kbuild, lkml
Subsystem: keys/keyrings, the rest · Maintainers: David Howells, Jarkko Sakkinen, Linus Torvalds

The keyctl_dh_params struct uses a C++ keyword as structural members.  Fix
this by inserting an anonymous union that provides an alternative name and
then hide the reserved name in C++.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Mat Martineau <redacted>
cc: keyrings@vger.kernel.org
---

 include/uapi/linux/keyctl.h |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/keyctl.h b/include/uapi/linux/keyctl.h
index 7b8c9e19bad1..170f015d1f25 100644
--- a/include/uapi/linux/keyctl.h
+++ b/include/uapi/linux/keyctl.h
@@ -65,7 +65,12 @@
 
 /* keyctl structures */
 struct keyctl_dh_params {
-	__s32 private;
+	union {
+#ifndef __cplusplus
+		__s32 private;
+#endif
+		__s32 dh_private;
+	};
 	__s32 prime;
 	__s32 base;
 };
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help