Cleanup GCC compiler attributes

Added define 'unused_' for '__attribute__((unused))'. The oldest version
of GCC with online docs (GCC 2.95.3, released in March 16, 2001 [1])
already has support for this attribute, so it doesn't make sense to
check the version.

Renamed 'noreturn' to 'noreturn_' for consistency.

[1] https://gcc.gnu.org/onlinedocs/

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-04-02 22:25:09 +01:00
parent cbaaec98ca
commit 1b4187e51f
8 changed files with 21 additions and 16 deletions

View File

@@ -11,10 +11,12 @@
#ifdef __GNUC__
/* GCC or compatible */
#define noreturn __attribute__ ((noreturn))
#define noreturn_ __attribute__ ((noreturn))
#define unused_ __attribute__ ((unused))
#else
/* Unsupported, but no need to throw a fit */
#define noreturn
#define noreturn_
#define unused_
#endif
#endif /* HELPERS_H */