sizeof(int[1]) means what ?

sdptroy3 at gmail.com sdptroy3 at gmail.com
Sun Feb 17 10:02:24 EST 2013


hi,
i'm reading the file ioctl.h, there i encountered a macro
_IOC_TYPECHECK(t) which looks like:
#define _IOC_TYPECHECK(t) \
	((sizeof(t) == sizeof(t[1]) && \
	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
	  sizeof(t) : __invalid_size_argument_for_IOC)

in this code ,what does sizeof(t[1]) mean? i mean the argument of this
macro in a type(int, float), in that case what does sizeof(int[1])
specify? I have written a small test program which prints the value of
the expression 4.

Thank you



More information about the Kernelnewbies mailing list