[RFC] Require extern modifier for function prototypes in headers.

Pierre Muller
2012-12-19T11:25:11Z

Following the discussion triggered by my latest
RFA/OBVIOUS? email,
Joel proposed that I added a change to GDB coding styles.

Here it is.

Currently you can use "extern" modifier or leave it out.
Apparently it should make no difference for function prototypes,
but I still find it strange to have all functions but one
being declared with "extern", like in ui-file.h header.

Comments mowt welcome,

Pierre Muller
GDB pascal language maintainer

2012-12-19 Pierre Muller <muller@sourceware.org>

* gdbint.texinfo (Function prototypes): Require use of "extern"
modifier for function prototypes in headers.

Index: gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.344
diff -u -r1.344 gdbint.texinfo
--- gdbint.texinfo 16 Dec 2012 19:00:04 -0000 1.344
+++ gdbint.texinfo 19 Dec 2012 11:19:40 -0000
@@ -5935,7 +5935,8 @@
function definition.

All external functions should have a declaration in a header file that
-callers include, except for @code{_initialize_*} functions, which must
+callers include, that declaration should use the @code{extern} modifier.
+The only exception concerns @code{_initialize_*} functions, which must
be external so that @file{init.c} construction works, but shouldn't be
visible to random source files.