problem with gcc and __unused function attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello,

dma is now running on Arch Linux but I found one odd thing:
There is this function in net.c:

static void
sig_alarm(int signo __unused)
{
	longjmp(timeout_alarm, 1);
}

ggc can't handle the __unused attribute:
[mickraus@gandalf dma]\$ LANG=us gcc -DHAVE_CRYPTO -o dma dma.c conf.c
crypto.c lex.yy.c y.tab.c net.c base64.c -lssl net.c:68: error:
expected ';', ',' or ')' before '__unused' net.c: In function
'read_remote': net.c:105: error: 'sig_alarm' undeclared (first use in
this function) net.c:105: error: (Each undeclared identifier is
reported only once net.c:105: error: for each function it appears in.)

After removing the attribute everything works.

But in the gcc manual exactly this attribute is listed:
http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Function-Attributes.html

The original net.c file can be found here:
http://opengrok.creo.hu/dragonfly/xref/src/libexec/dma/net.c

To compile it on linux you have to include two additional headers:
#ifdef __linux
#include <stdarg.h>
#include <err.h>
#endif /* __linux */

Is there a compiler switch that I have overlooked?

Kind Regards
Michael Krauss



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux