patch-2.4.20 linux-2.4.20/Documentation/DocBook/kernel-hacking.tmpl

Next file: linux-2.4.20/Documentation/DocBook/parportbook.tmpl
Previous file: linux-2.4.20/Documentation/DocBook/journal-api.tmpl
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/Documentation/DocBook/kernel-hacking.tmpl linux-2.4.20/Documentation/DocBook/kernel-hacking.tmpl
@@ -1091,18 +1091,17 @@
    <title>Initializing structure members</title>
 
    <para>
-    The preferred method of initializing structures is to use the
-    gcc Labeled Elements extension, eg:
+    The preferred method of initializing structures is to use
+    designated initialisers, as defined by ISO C99, eg:
    </para>
    <programlisting>
 static struct block_device_operations opt_fops = {
-        open:                   opt_open,
-        release:                opt_release,
-        ioctl:                  opt_ioctl,
-        check_media_change:     opt_media_change,
+        .open               = opt_open,
+        .release            = opt_release,
+        .ioctl              = opt_ioctl,
+        .check_media_change = opt_media_change,
 };
    </programlisting>
-
    <para>
     This makes it easy to grep for, and makes it clear which
     structure fields are set.  You should do this because it looks

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)