[phobos] Usage of asserts/contracts and memory safety

Vladimir Panteleev thecybershadow.lists at gmail.com
Wed Aug 24 20:30:56 PDT 2011


Hi,

I noticed that Phobos's makefile specifies -release, however there are  
places in Phobos which use asserts and contracts. I recall there being a  
discussion regarding verification of parameters in Phobos, but I do not  
know the current consensus. DMD has -defaultlib and -debuglib switches,  
which could justify usage of asserts/contracts, but they are not used in  
the default configuration.

I'm currently working on making std.socket.SocketSet memory-safe (adding  
sockets past the fd_set capacity is not currently checked), and I'd like  
to know if these checks should be done with "enforce" in the function  
body, or "assert" in "in" contracts etc.?

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the phobos mailing list