linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Suggested janitor task - remove __init/__exit from function prototypes
@ 2006-01-15  2:11 Keith Owens
  2006-01-17 16:55 ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Owens @ 2006-01-15  2:11 UTC (permalink / raw)
  To: linux-kernel

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Suggested janitor task - remove __init/__exit from function prototypes
  2006-01-15  2:11 Suggested janitor task - remove __init/__exit from function prototypes Keith Owens
@ 2006-01-17 16:55 ` Jan Engelhardt
  2006-01-17 17:01   ` Ismail Donmez
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2006-01-17 16:55 UTC (permalink / raw)
  To: Keith Owens; +Cc: linux-kernel

>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.

How does gcc 2.95 handle it, requiring __init in both spots?


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Suggested janitor task - remove __init/__exit from function prototypes
  2006-01-17 16:55 ` Jan Engelhardt
@ 2006-01-17 17:01   ` Ismail Donmez
  2006-01-17 20:03     ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Ismail Donmez @ 2006-01-17 17:01 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-kernel, Keith Owens

Salı 17 Ocak 2006 18:55 tarihinde şunları yazmıştınız:
> >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.
>
> How does gcc 2.95 handle it, requiring __init in both spots?

gcc 3.2 is now required for mainline kernel.

/ismail

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Suggested janitor task - remove __init/__exit from function prototypes
  2006-01-17 17:01   ` Ismail Donmez
@ 2006-01-17 20:03     ` Jan Engelhardt
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Engelhardt @ 2006-01-17 20:03 UTC (permalink / raw)
  To: Ismail Donmez; +Cc: linux-kernel, Keith Owens

>> >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.
>>
>> How does gcc 2.95 handle it, requiring __init in both spots?
>
>gcc 3.2 is now required for mainline kernel.
>
Sure, but I asked because I maintain one piece of code (ttyrpld) that 
should compile for both 2.4 and 2.6. OTOH, I could use it to make people 
convert to 2.6 ;-)


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-17 20:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-15  2:11 Suggested janitor task - remove __init/__exit from function prototypes Keith Owens
2006-01-17 16:55 ` Jan Engelhardt
2006-01-17 17:01   ` Ismail Donmez
2006-01-17 20:03     ` Jan Engelhardt

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).