Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
01107300
Commit
01107300
authored
Aug 27, 2002
by
Sam Ravnborg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] kerneldoc: In kernel-hacking describe designated initialisers
Designated initialisers as per ISO C99
parent
6f834a78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
Documentation/DocBook/kernel-hacking.tmpl
Documentation/DocBook/kernel-hacking.tmpl
+6
-7
No files found.
Documentation/DocBook/kernel-hacking.tmpl
View file @
01107300
...
...
@@ -1085,18 +1085,17 @@ EXPORT_NO_SYMBOLS;
<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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment