qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Eric Blake" <eblake@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH v3 7/9] tests/style: check qemu/osdep.h is included in all .c files
Date: Thu,  7 Jul 2022 17:37:18 +0100	[thread overview]
Message-ID: <20220707163720.1421716-8-berrange@redhat.com> (raw)
In-Reply-To: <20220707163720.1421716-1-berrange@redhat.com>

The qemu/osdep.h file must be included as the very first header in
all C source files, to ensure its definitions take effect over all
other header files, including system headers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/style.yml | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/tests/style.yml b/tests/style.yml
index d06c55bb29..6d91ac6115 100644
--- a/tests/style.yml
+++ b/tests/style.yml
@@ -120,4 +120,26 @@ double_words:
     - pc-bios/
     - qemu-options\.hx
     - scripts/checkpatch\.pl
-    - tests/qtest/arm-cpu-features\.c
\ No newline at end of file
+    - tests/qtest/arm-cpu-features\.c
+
+osdep_h_in_source:
+  multiline: true
+  files: \.c$
+  require: ^((?!#include)[^\n]*\n)*#include "qemu/osdep.h"
+  message: all C source files must include qemu/osdep.h, as the first header
+  ignore:
+    - contrib/plugins/.*
+    - linux-user/(mips64|x86_64)/(signal|cpu_loop)\.c
+    - pc-bios/.*
+    - scripts/coverity-scan/model\.c
+    - scripts/xen-detect\.c
+    - subprojects/.*
+    - target/hexagon/(gen_semantics|gen_dectree_import)\.c
+    - target/s390x/gen-features\.c
+    - tests/migration/s390x/a-b-bios\.c
+    - tests/multiboot/.*
+    - tests/plugin/.*
+    - tests/tcg/.*
+    - tests/uefi-test-tools/.*
+    - tests/unit/test-rcu-(simpleq|slist|tailq)\.c
+    - tools/ebpf/rss.bpf.c
-- 
2.36.1



  parent reply	other threads:[~2022-07-07 16:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 16:37 [PATCH v3 0/9] tests: introduce a tree-wide code style checking facility Daniel P. Berrangé
2022-07-07 16:37 ` [PATCH v3 1/9] tests: introduce tree-wide code style checking Daniel P. Berrangé
2022-07-20 16:25   ` Peter Maydell
2022-07-20 16:31     ` Daniel P. Berrangé
2022-07-20 17:08       ` Eric Blake
2022-07-20 17:38         ` Peter Maydell
2022-07-25 15:25       ` Peter Maydell
2022-07-21 14:54   ` Eric Blake
2022-07-07 16:37 ` [PATCH v3 2/9] misc: fix mixups of bool constants with int variables Daniel P. Berrangé
2022-07-11 14:18   ` Peter Maydell
2022-07-07 16:37 ` [PATCH v3 3/9] tests/style: check for " Daniel P. Berrangé
2022-07-11 16:24   ` Philippe Mathieu-Daudé via
2022-07-13  8:21     ` Daniel P. Berrangé
2022-07-07 16:37 ` [PATCH v3 4/9] misc: fix commonly doubled up words Daniel P. Berrangé
2022-07-11 14:21   ` Peter Maydell
2022-07-07 16:37 ` [PATCH v3 5/9] tests/style: check for " Daniel P. Berrangé
2022-07-07 16:37 ` [PATCH v3 6/9] misc: ensure qemu/osdep.h is included first in all .c files Daniel P. Berrangé
2022-07-07 16:37 ` Daniel P. Berrangé [this message]
2022-07-21 19:13   ` [PATCH v3 7/9] tests/style: check qemu/osdep.h is included " Eric Blake
2022-07-07 16:37 ` [PATCH v3 8/9] misc: remove qemu/osdep.h from headers / included source files Daniel P. Berrangé
2022-07-11 16:20   ` Philippe Mathieu-Daudé via
2022-07-20 17:10   ` Eric Blake
2022-07-07 16:37 ` [PATCH v3 9/9] tests/style: check qemu/osdep.h is NOT included in all .h/.c.inc files Daniel P. Berrangé
2022-07-11 16:21   ` Philippe Mathieu-Daudé via
2022-07-21 19:16   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220707163720.1421716-8-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=eblake@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).