From: Stefan Knoblich Date: Mon, 6 May 2013 15:41:50 +0000 (+0200) Subject: FreeTDM: Add ftdm_unused_arg() macro to silence "unused parameter" compiler warnings X-Git-Tag: v1.5.1~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81702d18fbb043e73f300eb433ba71d58f7aaa6b;p=thirdparty%2Ffreeswitch.git FreeTDM: Add ftdm_unused_arg() macro to silence "unused parameter" compiler warnings Signed-off-by: Stefan Knoblich --- diff --git a/libs/freetdm/src/include/ftdm_os.h b/libs/freetdm/src/include/ftdm_os.h index c34810d241..f2adc8742a 100644 --- a/libs/freetdm/src/include/ftdm_os.h +++ b/libs/freetdm/src/include/ftdm_os.h @@ -130,6 +130,18 @@ typedef uint64_t ftdm_time_t; */ #define ftdm_container_of(ptr,type,member) (type *)((uintptr_t)(ptr) - ftdm_offset_of(type, member)) +/*! + * \brief Silence "unused parameter" compiler warnings + * \note Tested with VS 2010, GCC 4.8, clang 3.1 and suncc + * \code + * int example(char *a) { + * ftdm_unused_arg(a); + * return 0; + * } + * \endcode + */ +#define ftdm_unused_arg(x) (void)(x) + /*! \brief The memory handler. Do not use directly this variable, use the memory macros and ftdm_global_set_memory_handler to override */