]> sigrok.org Git - libsigrok.git/blobdiff - src/libsigrok-internal.h
Avoid warnings on all-zero static struct entries.
[libsigrok.git] / src / libsigrok-internal.h
index fea409f06cadd7f57e32971469513291358ca317..6ce868834b0aab26b087d6cd130c20c4ec32f479 100644 (file)
        libusb_handle_events_timeout(ctx, tv)
 #endif
 
+/* Static definitions of structs ending with an all-zero entry are a
+ * problem when compiling with -Wmissing-field-initializers: GCC
+ * suppresses the warning only with { 0 }, clang wants { } */
+#ifdef __clang__
+#define ALL_ZERO { }
+#else
+#define ALL_ZERO { 0 }
+#endif
+
 struct sr_context {
 #ifdef HAVE_LIBUSB_1_0
        libusb_context *libusb_ctx;