diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-05-06 15:43:54 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-05-06 15:43:54 +0000 |
commit | 09c9d37c5f20c98e7d560dc14046c101ef3f9d27 (patch) | |
tree | d2da5b42bf2ecc91dc2720db357e0978012ac054 /src/CODESTYLE | |
parent | 2018467e596bdade28b1a468cd1c6e4bcf5d33ef (diff) |
add #ifndef include guards to a bunch of files, even though they shouldn't
be necessary (I never include a file twice!)... since certain lame/broken/dumb
compilers (like DEC/Compaq/HP/whatever-they-call-themselves-this-week
C++ version 6.something on Alpha Linux) still give multiple inclusions
even with automagic template instantiation turned off :( :( :(
-- thanks to Frank Loeffler for helping track this problem down!
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1050 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/CODESTYLE')
-rw-r--r-- | src/CODESTYLE | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/CODESTYLE b/src/CODESTYLE index ed92163..56be3ea 100644 --- a/src/CODESTYLE +++ b/src/CODESTYLE @@ -1,6 +1,6 @@ AHFinderDirect Code Style ========================= -$Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/CODESTYLE,v 1.1 2003-03-22 18:56:49 jthorn Exp $ +$Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/CODESTYLE,v 1.2 2003-05-06 15:43:54 jthorn Exp $ This file documents some general programming conventions used in this thorn. @@ -17,6 +17,13 @@ so I've written my own (src/mpp). *.minc Maple headers to be @included by my Maple preprocessor *.mm Maple code (output from my Maple preprocessr) +None of my header files ever #includes another file, so in theory there's +no problem with multiple inclusion. However, see "C++ Templates" below +for some ugly compiler problems with this... + + +Configuration +============= Only a few options are configured at compile-time; these use #defines in src/include/config.h. @@ -143,6 +150,28 @@ boost::array, and my jtutil::array[1234]d<> classes should be converted to boost::multi_array. +C++ Templates +============= + +I use C++ templates, but not for anything fancy, just simple containers. +I instantiate all templates explicitly. + +Some C++ compilers offer "automatic" template instantiation. In practice +this often causes compilation to fail when the compiler can't find .cc +files in other directories. So, I highly recommend turning *off* all +automatic template instantiation "features". + +When using the DEC/Compaq/HP/whatever-their-corporate-name-is-this-week +C++ compiler (version 6.3.6.8) under Alpha Linux, even with automatic +template instiation disabled, the compiler *still* seems to include some +header files multiple times. To avoid duplicate-definition errors caused +by this, I have protected all the header files in the subdirectories + include/ + jtutil/ + elliptic/ +against multiple inclusion with the standard #ifndef trick. + + Miscellaneous ============= |