Displaying 3 results from an estimated 3 matches for "27f6ed1".
2019 Jan 02
0
[PATCH nbdkit v2 2/2] include: Only use attribute((format)) on GCC or Clang.
...doesn't support
attribute((format)), a non-standard C extension.
Note that we still require GCC or Clang for compiling nbdkit.
---
include/nbdkit-common.h | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/nbdkit-common.h b/include/nbdkit-common.h
index 27f6ed1..36fce20 100644
--- a/include/nbdkit-common.h
+++ b/include/nbdkit-common.h
@@ -45,6 +45,13 @@
extern "C" {
#endif
+#if defined(__GNUC__) || defined(__clang__)
+#define ATTRIBUTE_FORMAT_PRINTF(fmtpos, argpos) \
+ __attribute__((__format__ (__printf__, fmtpos, argpos)))
+#else
+#defin...
2019 Jan 01
3
[PATCH nbdkit] include: Annotate function parameters with attribute((nonnull)).
Should we use attribute((nonnull)) at all? There's a very interesting
history of this in libvirt -- try looking at commit eefb881 plus the
commits referencing eefb881 -- but it does seem to work for me using
recent GCC and Clang.
I only did a few functions because annotating them gets old quickly...
Rich.
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html
In v2 I have provided two patches:
The first patch extends attribute((nonnull)) to most internal
functions, but not to the external API.
The second patch uses a macro so that attribute((format)) is only used
in the public API on GCC or Clang. At least in theory these headers
could be used by a C compiler which