I saw once a usage of the macro __unused
which is explained here, but for some reason I can't find now where it is defined. Will appreciate help. I need it for an ansi C project. Thanks.
Asked
Active
Viewed 242 times
0

Elad Weiss
- 3,662
- 3
- 22
- 50
-
2It's not an ANSI C macro however. – StoryTeller - Unslander Monica Mar 14 '18 at 13:32
-
Also, you might wanna forget about "ANSI C" and instead use ISO C. The C language has been internationally standardized since the year 1990. – Lundin Mar 14 '18 at 13:33
-
@Lundin good to know. I thought it just a term for "not c++". – Elad Weiss Mar 14 '18 at 13:40
-
3"C" in and of itself implies "not C++". – StoryTeller - Unslander Monica Mar 14 '18 at 13:41
-
@StoryTeller Can I define the macro myself? – Elad Weiss Mar 14 '18 at 13:42
-
1@EladWeiss - I wouldn't define *that* macro (the two underscore spiel is reserved). But nothing is stopping you from defining your own macro that expands to `__attribute__((unused))`. – StoryTeller - Unslander Monica Mar 14 '18 at 13:43
-
@EladWeiss: you can, but you should not. `__` is a reserved prefix. By definining something in it, you should break things. – Giacomo Catenazzi Mar 14 '18 at 13:44
1 Answers
1
unused
is GCC specific 6.32.1 Common Variable Attributes
This attribute, attached to a variable, means that the variable is meant to be possibly unused. GCC
does not produce a warning for this variable.
NTERNATIONAL STANDARD ©ISO/IEC ISO/IEC 9899:201x does not even mention unused
.

sg7
- 6,108
- 2
- 32
- 40