I also got into colon notation, but in my context, bit fields didn't make sense. So I did the digging. This notation is also used to assign values - in my particular situation, function pointers.
Source: http://www.tldp.org/LDP/lkmpg/2.4/html/c577.htm
Below is a sample and excerpt for explanation.
" There is a gcc extension that makes this structure more convenient . You will see it in modern drivers and you may be surprised. This new way of assigning a structure looks like this:"
struct file_operations fops = { read: device_read, write: device_write, open: device_open, release: device_release };
The C99 (old, compatible) way looks like this:
struct file_operations fops = { .read = device_read, .write = device_write, .open = device_open, .release = device_release };
user27346 Oct 30 '13 at 18:32 2013-10-30 18:32
source share