Bug 11106
Summary: | asm-generic/ioctl.h can generate link error undefined __invalid_size_argument_for_IOC | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Bob Arendt (rda) |
Component: | Other | Assignee: | David Woodhouse (dwmw2) |
Status: | RESOLVED CODE_FIX | ||
Severity: | low | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | linux/kernel/git/stable/linux-2.6.25.y.git (using 2.6.25.10) | Subsystem: | |
Regression: | --- | Bisected commit-id: |
Description
Bob Arendt
2008-07-16 20:58:42 UTC
Fixed by commit 5f8c3c8edff426fd87098f057688463107fcd9ce When the ioctl command defined with _IOR etc. is used in a case statement, gcc (version 3.4.6) generates a compile time error: `__invalid_size_argument_for_IOC' cannot appear in a constant expression code example: #include <sys/ioctl.h> #define AQ_VERSION _IOR(0xa1, 0x14, int) ... switch (ioccmd) { case AQ_VERSION: ...; } This was fixed by commit 5f8c3c8edff426fd87098f057688463107fcd9ce. It sounds like you're using old or broken kernel headers. In /usr/include/asm-generic/ioctl.h, the macro _IOC_TYPECHECK should be unconditionally defined as follows: #define _IOC_TYPECHECK(t) (sizeof(t)) If your distribution is not using the headers generated by running 'make headers_install' against a recent kernel, please file a bug against your distribution. I can confirm that this commit shows up in Fedora 10. But it does not in Redhat 5.2 (I'll file a bug) |