qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-4.0] compiler.h: Add an explicit check for the compiler version
@ 2018-11-30 10:43 Thomas Huth
  2018-11-30 10:46 ` Paolo Bonzini
  2018-11-30 11:15 ` Daniel P. Berrangé
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Huth @ 2018-11-30 10:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, pbonzini, berrange, peter.maydell

The questions about our minimum compiler requirement pops up every
couple of months, and we then have to recall the details each time.
So let's document this in a proper way, by adding a comment and
check for the right compiler version to our compiler.h header.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/qemu/compiler.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index ca9bc85..775446b 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -22,6 +22,14 @@
 # define QEMU_GNUC_PREREQ(maj, min) 0
 #endif
 
+/*
+ * We need at least GCC 4.1 for atomics support. Clang also supports these,
+ * and reports itself as GCC 4.2, so it passes this check, too.
+ */
+#if !QEMU_GNUC_PREREQ(4, 1)
+#error QEMU needs a compiler that is compatible with GCC v4.1 or newer
+#endif
+
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 
 #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-30 14:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-30 10:43 [Qemu-devel] [PATCH for-4.0] compiler.h: Add an explicit check for the compiler version Thomas Huth
2018-11-30 10:46 ` Paolo Bonzini
2018-11-30 11:15 ` Daniel P. Berrangé
2018-11-30 12:30   ` Thomas Huth
2018-11-30 12:46     ` Paolo Bonzini
2018-11-30 12:52       ` Thomas Huth
2018-11-30 14:47         ` Daniel P. Berrangé
2018-11-30 13:04     ` Daniel P. Berrangé

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).