This question appeared when I recently opened a rather old driver for my raid device. To be able to compile the driver for a Linux system, I started to investigate on all those errors I got on output. And I came across this kind of syntax used in the driver sources:
struct file_operations t3_fops = {
owner: THIS_MODULE,
ioctl: ft_ioctl,
fasync: ft_fasync,
open: ft_open,
release: ft_release
};
So guys, could you help me to understand what does “:” mean? Is this C syntax at all? I know there is a bit field definition, but this looks rather different to me.
This syntax for initializing structure members is called a designated initializer. The
:is older GCC-specific syntax. This is documented in the GCC manual.