From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Subject: Suggested janitor task - remove __init/__exit from function prototypes
Date: Sun, 15 Jan 2006 13:11:35 +1100 [thread overview]
Message-ID: <31582.1137291095@ocs3.ocs.com.au> (raw)
Some function prototypes (in both .h and .c files) specify attributes
like __init and __exit in the prototype. gcc (at least at 3.3.3) uses
the last such attribute that is actually specified, without issuing a
warning. So we can have :-
* Prototype declarations that use one attribute and a function body
that uses another attribute.
* Functions that from the .c code appear to be normal text but the .h
file is silently setting a special attribute.
Both are potential sources of programmer confusion or bugs. I suggest
a janitor task to find all function prototypes that use __init, __exit,
__devinit, __devexit, __cpuinit or __cpuexit and remove the attribute
from the prototype. If the function body does not already specify a
suitable attribute then add the attribute to the function body.
The same task could be done for extern data declarations.
Once that is done, remove #include <linux/init.h> from all .h files.
Only .[cS] files should specify which section the data and text are
stored in, .h files should only define the C language information.
next reply other threads:[~2006-01-15 2:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-15 2:11 Keith Owens [this message]
2006-01-17 16:55 ` Suggested janitor task - remove __init/__exit from function prototypes Jan Engelhardt
2006-01-17 17:01 ` Ismail Donmez
2006-01-17 20:03 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31582.1137291095@ocs3.ocs.com.au \
--to=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).