The documentation for GCC’s __attribute__((...)) syntax indicates that attributes must be surrounded by double parentheses, but does not give a rationale for this design decision.
What practical reason would have caused GCC’s designers to require this? Does it have anything to do with the preprocessor’s handling of double parentheses?
To make it easier to eliminate it for different compiler. If you have portable code, you have to remove them for other compilers, so you do
The problem is that attributes have various number of arguments and you can combine multiple attributes in one
__attribute__declaration, but C only introduced variadic macros in C99. With double parenthesis the above definition does not need variadic macros.