Writing Bug-Free C/D Code

Sean Kelly sean at f4.ca
Wed Mar 21 10:43:58 PDT 2007


Dan wrote:
> Sean Kelly Wrote:
>> My only regret is that the current crop of D compilers don't offer any 
>> means of linking a separate library for 'debug' and 'release' builds (a 
>> bad choice of words for the associated effects).
> 
> I think you actually can link in different modules accordingly, via
 > static ifs, version, debug { import x; } etc.  I think you mean phobos
 > vs. tango etc. though right?

One problem with pragma(lib) is that it only works if the pragma is in a 
module being compiled into the program.  It has no effect if it is in a 
'header' module.  So unless bud/rebuild is being used to construct the 
application, library developers have no way to automatically link a 
specific library using static if, version, etc.  And for something 
fairly fundamental like Phobos or Tango, I'm not sure it's appropriate 
to expect the user to explicitly link a debug, release, or debug/release 
build (yes, both flags can be specified simultaneously in D).


Sean



More information about the Digitalmars-d mailing list