summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/basedefs.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-21 13:28:01 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-22 07:29:26 +0200
commite8020d1914b58c05a1a796b486e5a8fb23abe188 (patch)
treee3f99db14fc1d4a190f6608ecab83607185d25f2 /cpukit/score/include/rtems/score/basedefs.h
parentMake rtems_fprintf_plugin() static (diff)
downloadrtems-e8020d1914b58c05a1a796b486e5a8fb23abe188.tar.bz2
Rename and move RTEMS_PRINTF_ATTRIBUTE()
Rename RTEMS_PRINTF_ATTRIBUTE() into RTEMS_PRINTFLIKE() (similar to <sys/cdefs.h> __printflike()) and move it to <rtems/score/basedefs.h>.
Diffstat (limited to 'cpukit/score/include/rtems/score/basedefs.h')
-rw-r--r--cpukit/score/include/rtems/score/basedefs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 24a56f2f51..7e691b579d 100644
--- a/cpukit/score/include/rtems/score/basedefs.h
+++ b/cpukit/score/include/rtems/score/basedefs.h
@@ -210,6 +210,17 @@
#define RTEMS_UNREACHABLE() _Assert_Unreachable()
#endif
+/**
+ * @brief Tells the compiler that this function expects printf()-like
+ * arguments.
+ */
+#if defined(__GNUC__)
+ #define RTEMS_PRINTFLIKE( _format_pos, _ap_pos ) \
+ __attribute__((__format__(__printf__, _format_pos, _ap_pos)))
+#else
+ #define RTEMS_PRINTFLIKE( _format_pos, _ap_pos )
+#endif
+
#if __cplusplus >= 201103L
#define RTEMS_STATIC_ASSERT(cond, msg) \
static_assert(cond, # msg)