Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
attribute_unused.hpp File Reference

Macros

#define MUNDY_HAVE_ATTRIBUTE(x)
 A helper macro for checking if a compiler supports a given attribute.
#define MUNDY_ATTRIBUTE_UNUSED
 A helper macro for forcing the compiler to compile an unused variable.

Macro Definition Documentation

◆ MUNDY_HAVE_ATTRIBUTE

#define MUNDY_HAVE_ATTRIBUTE ( x)
Value:
0

A function-like feature checking macro that is a wrapper around __has_attribute, which is defined by GCC 5+ and Clang and evaluates to a nonzero constant integer if the attribute is supported or 0 if not.

It evaluates to zero if __has_attribute is not defined by the compiler.

GCC: https://gcc.gnu.org/gcc-5/changes.html Clang: https://clang.llvm.org/docs/LanguageExtensions.html

◆ MUNDY_ATTRIBUTE_UNUSED

#define MUNDY_ATTRIBUTE_UNUSED

This macro is repurposed from GTEST_ATTRIBUTE_UNUSED_ in gtest-port.h. It is used to force the compiler to compile a variable that is otherwise unused. Use this annotation after a variable or parameter declaration to tell the compiler the variable/parameter does not have to be used but should be compiled anyway. Example usage:

// MUNDY_ATTRIBUTE_UNUSED int foo = bar();