Rationale behind 'extern' on protypes in .h files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am a C & Data Structure teacher at at an institute. Up until now I
have only written classroom type C code. I always had interest in
operating systems especially Linux Kernel but never got into anything
just passively followed 'lwn.net', 'dr dobbs magazine' etc.

But the series '30 Linux Kernel Developers in 30 Weeks' on 'linux.com'
has really pushed me over the edge and  I have this new found interest
towards Linux and C. As these articles suggest that I should have a
good experience in user space before I can even touch the kernel. So
to get a feel of how actual real world C projects look like I have
taken two excellent projects as my reference 'Git' and 'libvirt'. Also
'Linux Formrnal Scratch' to get started towards Linux internals.

Although I have a good understanding of the basic/advanced concepts
like pointers, memory management etc but many concepts like good error
handling mechanism, unit testing, build systems etc. were always
blurry but I know that this is just a start towards a long journey
towards Linux Kernel.


Now, my real question :
1) I cannot understand the reason behind making function prototypes as
extern. What purpose does this serve? AFAIK we put definition in a .c
file and the prototype in a .h thats it.

2) Why are some  prototypes in some of the .h file are extern and
others are not?

Thank you guys for reading through. Any suggestions are humbly welcome.
Ravi S. Jethani
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]