[PATCH v3 09/12] libctf: work with compilers not supporting GNU C attributes

Nick Alcock nick.alcock@oracle.com
Thu Jun 25 20:14:02 GMT 2020


The obvious fallback __attribute__ stanza was missing.

Thanks to Harald van Dijk.

	PR 25120
libctf/
	* ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
	(_libctf_unlikely_): Likewise.
	(_libctf_unused): Likewise.
	(_libctf_malloc_): Likewise.
---
 libctf/ctf-impl.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libctf/ctf-impl.h b/libctf/ctf-impl.h
index ade1a6e7cc4..133ca0ee6e2 100644
--- a/libctf/ctf-impl.h
+++ b/libctf/ctf-impl.h
@@ -59,6 +59,13 @@ extern "C"
 #define _libctf_unused_ __attribute__ ((__unused__))
 #define _libctf_malloc_ __attribute__((__malloc__))
 
+#else
+
+#define _libctf_printflike_(string_index,first_to_check)
+#define _libctf_unlikely_(x) (x)
+#define _libctf_unused_
+#define _libctf_malloc_
+
 #endif
 
 /* libctf in-memory state.  */
-- 
2.27.0.247.g3dff7de930



More information about the Binutils mailing list