mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add a comment about ATTRIBUTE_UNUSED to avoid further confusion over when to
use it. llvm-svn: 116920
This commit is contained in:
parent
55850cad48
commit
7763c845be
@ -31,6 +31,14 @@
|
||||
#define ATTRIBUTE_USED
|
||||
#endif
|
||||
|
||||
// Some compilers warn about unused functions. When a function is sometimes
|
||||
// used or not depending on build settings (e.g. a function only called from
|
||||
// within "assert"), this attribute can be used to suppress such warnings.
|
||||
//
|
||||
// However, it shouldn't be used for unused *variables*, as those have a much
|
||||
// more portable solution:
|
||||
// (void)unused_var_name;
|
||||
// Prefer cast-to-void wherever it is sufficient.
|
||||
#if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
||||
#define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user