lkml.org 
[lkml]   [2013]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PCI: Remove "extern" from function declarations
Hi Bjorn,

I just noticed this commit (f39d5b72913e "PCI: Remove "extern" from
function declarations") in the pci next branch. Just wondering why you
would do such a thing. It is a lot of churn in quite a few header files
and (in my opinion) goes the wrong way anyway.

It may not actually make any difference to the compiler for functions, but
for variables, it does. A variable declared in a header file without
"extern" will effectively define it in every compilation that includes
the header file, one with "extern" will only produce references.

So, since, the global variables really should have the "extern", the
functions are now inconsistent with that.

It also means that when someone copies a function declaration to make a
"static inline" stub, the "extern" is a big hint for them to remember to
make the stub "static" - I have seen several occasions when this was not
done and that causes compilation failures (but usually only in the
configuration that the author did not bother to test).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-04-18 01:41    [W:0.033 / U:1.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site