From ae9ba5bb6dae81b9950942dea78edb3257cf6611 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Tue, 11 Feb 2014 15:40:49 +0000 Subject: [PATCH] eal: fix support for older gcc versions older versions of gcc don't support the cold attribute so make its presence conditional. Signed-off-by: Bruce Richardson --- lib/librte_eal/common/include/rte_debug.h | 4 ++++ lib/librte_eal/common/include/rte_log.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h index 8f3ba6e0a3..675378e138 100644 --- a/lib/librte_eal/common/include/rte_debug.h +++ b/lib/librte_eal/common/include/rte_debug.h @@ -85,7 +85,11 @@ void rte_dump_registers(void); * documentation. */ void __rte_panic(const char *funcname , const char *format, ...) +#ifdef __GNUC__ +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) __attribute__((cold)) +#endif +#endif __attribute__((noreturn)) __attribute__((format(printf, 2, 3))); diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index ca7a6d2d56..dd61331317 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -219,7 +219,11 @@ int rte_log_add_in_history(const char *buf, size_t size); * - Negative on error. */ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...) +#ifdef __GNUC__ +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) __attribute__((cold)) +#endif +#endif __attribute__((format(printf, 3, 4))); /** -- 2.20.1