[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disal
From: |
Pierrick Bouvier |
Subject: |
[PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures |
Date: |
Tue, 26 Nov 2024 13:17:35 -0800 |
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
docs/devel/style.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index 2f68b500798..13cb1ef626b 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -416,6 +416,16 @@ definitions instead of typedefs in headers and function
prototypes; this
avoids problems with duplicated typedefs and reduces the need to include
headers from other headers.
+Bitfields
+---------
+
+C bitfields can be a cause of non-portability issues, especially under windows
+where `MSVC has a different way to layout them than gcc
+<https://gcc.gnu.org/onlinedocs/gcc/x86-Type-Attributes.html>`_.
+For this reason, we disallow usage of bitfields in packed structures.
+For general usage, using bitfields should be proven to add significant benefits
+regarding memory usage or usability.
+
Reserved namespaces in C and POSIX
----------------------------------
--
2.39.5
- [PATCH v2 0/3] Enable clang build on Windows, Pierrick Bouvier, 2024/11/26
- [PATCH v2 1/3] win32: remove usage of attribute gcc_struct, Pierrick Bouvier, 2024/11/26
- [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures,
Pierrick Bouvier <=
- Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Peter Maydell, 2024/11/26
- Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Pierrick Bouvier, 2024/11/26
- Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Richard Henderson, 2024/11/27
- Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Pierrick Bouvier, 2024/11/27
- Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Richard Henderson, 2024/11/27
Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Thomas Huth, 2024/11/27
[PATCH v2 3/3] plugins: enable linking with clang/lld, Pierrick Bouvier, 2024/11/26