lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 18 Nov 2006 17:53:40 +1100
From:	Stephen Rothwell <sfr@...b.auug.org.au>
To:	Oleg Verych <olecom@...wer.upol.cz>
Subject: Re: [RFC 6/7] Use an external declaration in exit.c for fs_cachep

On Sat, 18 Nov 2006 06:44:33 +0000 Oleg Verych <olecom@...wer.upol.cz> wrote:
>
>
> On 2006-11-18, Stephen Rothwell wrote:
> []
> >> --- linux-2.6.19-rc5-mm2.orig/kernel/exit.c	2006-11-15 16:48:11.485511089 -0600
> >> +++ linux-2.6.19-rc5-mm2/kernel/exit.c	2006-11-17 23:04:09.764530373 -0600
> >> @@ -48,6 +48,8 @@
> >>  #include <asm/pgtable.h>
> >>  #include <asm/mmu_context.h>
> >>
> >> +extern kmem_cache_t *fs_cachep;
> >
> > You know what I am going to say, right? :-)
>
> I know, externs must be in headers. Please, explain why.

So that there is only one declaration.  That way if it is changed,
everywhere that uses it will notice.  Also, the same header must be
included by the file that defines the variable or function so any
discrepancy between declaration and definition will be obvious.

i.e. we are protecting ourselves against change and making maintainance
easier.

In this particular case, the type is probably never going to change, but
consistency is good.

--
Cheers,
Stephen Rothwell                    sfr@...b.auug.org.au
http://www.canb.auug.org.au/~sfr/

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ