On Mar 14, 4:49 am, Hal Vaughan <h...@halblog.comwrote:
I have a file where I'm putting a lot of variable definitions.
Some of them will be maps that include references to
functions. This file will be processed (by include) before
other files are processed.
If I put protofunction definitions in this definition file and
the actual functions in another file, are there any
non-obvious consequences to this?
It depends on what you mean by "non-obvious". In general, any
time you expect to use the name of a function in a source file
other than where it is defined, you should put its declaration
in a separate header file, to be included both in the source
file where you define the function, and in all other source
files which use it. And make sure that all of the objects whose
source file includes that header (directly or indirectly) are
declared as depending on it in the make file---most versions of
make have different astuces to help automate this. (And any
time you don't expect to use the name of a function in another
source file, of course, you should put the function in an
anonymous namespace.)
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34