Results 1 to 1 of 1
Thread: Compilation error on Rhel5
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2007
Compilation error on Rhel5
I am using Rhel5 (kernel 2.6)
I am getting following compilation error from ioctl.h.
error: '__invalid_size_argument_for_IOC' cannot appear in a constant-expression
I modified the ioctl.h to fix the problem:
+ #ifdef __KERNEL__
/* provoke compile error for invalid uses of size argument */
extern unsigned int __invalid_size_argument_for_IOC;
#define _IOC_TYPECHECK(t) \
((sizeof(t) == sizeof(t) && \
sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
sizeof(t) : __invalid_size_argument_for_IOC)
+ #define _IOC_TYPECHECK(t) (sizeof(t))
I added the condition "#ifdef __KERNEL__"
I am checking whether "__KERNEL__" is defined, since it is not defined, It executes the else part and does not throw error.
The same problem is seen with Rhel5.1.
Since it is not good to modify "ioctl.h", Can anyone please let me know how it can be handled through the program.