Re: Rationale behind 'extern' on protypes in .h files

2013-12-23 Thread Jed Brown
Ravi Shekhar Jethani rsjeth...@gmail.com writes: To check this I installed the libgit2-dev package which installed: /usr/include/git2/*.h , /usr/lib/libgit2.so Now, I exported all symbols using: $ readelf -s /usr/lib/libgit2.so and tried to match these with 'externed' prototypes in the Git

Re: Rationale behind 'extern' on protypes in .h files

2013-12-22 Thread Stefan Beller
On 22.12.2013 16:51, Ravi Shekhar Jethani wrote: 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

Re: Rationale behind 'extern' on protypes in .h files

2013-12-22 Thread Jed Brown
Stefan Beller stefanbel...@googlemail.com writes: From my understanding there is no difference for functions declarations being set to extern or not, because extern is the default on functions. There is a difference for shared libraries if you would like to control which symbols are exported.