Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 464536 Details for
Bug 603472
>=app-emulation/virtualbox-guest-additions-5.1.12 fails to build with kernel 4.9.0 - error: uninitialized const member in 'union atomic_read(const atomic_t*)::<anonymous>'
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Uninitialized C++ const issue
0002-compiler.h-fix-C-uninitialized-const-issue.patch (text/plain), 1.72 KB, created by
Joakim Tjernlund
on 2017-02-21 15:13:08 UTC
(
hide
)
Description:
Uninitialized C++ const issue
Filename:
MIME Type:
Creator:
Joakim Tjernlund
Created:
2017-02-21 15:13:08 UTC
Size:
1.72 KB
patch
obsolete
>From 5e95af37e058a0c6d4cc316ad8c92d701d30996e Mon Sep 17 00:00:00 2001 >From: Joakim Tjernlund <joakim.tjernlund@infinera.com> >Date: Mon, 20 Feb 2017 16:52:49 +0100 >Subject: [PATCH 2/2] compiler.h: fix C++ uninitialized const issue > >C++ does not like the union { typeof(x) __val; char __c[1]; } __u >construct for const types: > error: uninitialized const member in > 'union atomic_read(const atomic_t*)::<anonymous>' >Address this by creating a C++ version of READ_ONCE where this union is >initialized: union { void _u(){}; typeof(x) __val; char __c[1]; } __u={0} > >To please gcc 6.3.0 also add in a _u(){} as default ctor. > >This makes C++ happy enough to build. > >Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> >--- > include/linux/compiler.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/include/linux/compiler.h b/include/linux/compiler.h >index cf0fa5d..0a047fd 100644 >--- a/include/linux/compiler.h >+++ b/include/linux/compiler.h >@@ -300,6 +300,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s > * required ordering. > */ > >+#ifndef __cplusplus > #define __READ_ONCE(x, check) \ > ({ \ > union { typeof(x) __val; char __c[1]; } __u; \ >@@ -309,6 +310,17 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s > __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ > __u.__val; \ > }) >+#else >+#define __READ_ONCE(x, check) \ >+({ \ >+ union { void _u(){}; typeof(x) __val; char __c[1]; } __u={0}; \ >+ if (check) \ >+ __read_once_size(&(x), __u.__c, sizeof(x)); \ >+ else \ >+ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ >+ __u.__val; \ >+}) >+#endif > #define READ_ONCE(x) __READ_ONCE(x, 1) > > /* >-- >2.10.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 603472
:
457128
|
462468
|
464534
| 464536 |
466462
|
466464
|
466466