Exact gcc version (Fedora 8): gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)
Following small code snippet:
static void remove_one(void);
static void __attribute__((__used__)) remove_one(void)
{
}
build with:
gcc -c -Wall test.c
produces following warning:
test.c:4: warning: ‘remove_one’ defined but not used
Removing the forward declaration (prototye) or
adding the attribute to the forward declaration make
the warning disappear.
I had expected the attribution on the function to take
precedence over the forward declaration.
Browsing the gcc manual did not reveal an answer and searching
the web / the bug database did not bring up an answer
so I decided to report it as a bug.
/Sam