As I understand it, function prototypes are intrinsically extern
and adding the keyword to them will not change functionality. I was looking at the source code for the Linux Kernel and came across the following:
extern bool console_suspend_enabled;
/* Suspend and resume console messages over PM events */
extern void suspend_console(void);
extern void resume_console(void);
int mda_console_init(void);
void prom_con_init(void);
void vcs_make_sysfs(int index);
void vcs_remove_sysfs(int index);
As you can see, some functions have extern
prefixed and some do not. This seemed to be present in a number of header files across the project making me wonder: is this just an inconsistency or is it for some sort of (old) compiler compatibility reason?
Source: https://github.com/torvalds/linux/blob/master/include/linux/console.h#L188