[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/18] docs/devel: make a statement about includes
From: |
Alex Bennée |
Subject: |
[PULL 16/18] docs/devel: make a statement about includes |
Date: |
Thu, 27 Apr 2023 16:45:08 +0100 |
While not explicitly disallowing header macro abuse (because that
would make us hypocrites) lets at least address some things to think
about.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230424092249.58552-17-alex.bennee@linaro.org>
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index 68aa776930..5bc6f2f095 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -300,6 +300,20 @@ putting those into qemu/typedefs.h instead of including
the header.
Cyclic inclusion is forbidden.
+Generative Includes
+-------------------
+
+QEMU makes fairly extensive use of the macro pre-processor to
+instantiate multiple similar functions. While such abuse of the macro
+processor isn't discouraged it can make debugging and code navigation
+harder. You should consider carefully if the same effect can be
+achieved by making it easy for the compiler to constant fold or using
+python scripting to generate grep friendly code.
+
+If you do use template header files they should be named with the
+``.c.inc`` or ``.h.inc`` suffix to make it clear they are being
+included for expansion.
+
C types
=======
--
2.39.2
- [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref, (continued)
- [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref, Alex Bennée, 2023/04/27
- [PULL 07/18] .gitlab-ci.d/cirrus: Drop the CI job for compiling with FreeBSD 12, Alex Bennée, 2023/04/27
- [PULL 11/18] avocado_qemu/__init__.py: factor out the qemu-img finding, Alex Bennée, 2023/04/27
- [PULL 10/18] MAINTAINERS: Cover tests/avocado/machine_aspeed.py, Alex Bennée, 2023/04/27
- [PULL 05/18] scripts/device-crash-test: Add a parameter to run with TCG only, Alex Bennée, 2023/04/27
- [PULL 08/18] tests/avocado: Make ssh_command_output_contains() globally available, Alex Bennée, 2023/04/27
- [PULL 12/18] tests/avocado/tuxrun_baselines.py: improve code coverage for ppc64, Alex Bennée, 2023/04/27
- [PULL 13/18] tests/tcg: limit the scope of the plugin tests, Alex Bennée, 2023/04/27
- [PULL 14/18] qemu-options.hx: Update descriptions of memory options for NUMA node, Alex Bennée, 2023/04/27
- [PULL 09/18] tests/avocado/machine_aspeed: Fix the broken ast2[56]00_evb_sdk tests, Alex Bennée, 2023/04/27
- [PULL 16/18] docs/devel: make a statement about includes,
Alex Bennée <=
- [PULL 15/18] docs/system: remove excessive punctuation from guest-loader docs, Alex Bennée, 2023/04/27
- [PULL 18/18] docs/style: call out the use of GUARD macros, Alex Bennée, 2023/04/27
- [PULL 17/18] docs/devel: mention the spacing requirement for QOM, Alex Bennée, 2023/04/27
- Re: [PULL 00/18] testing and doc updates, Richard Henderson, 2023/04/28