[OT] Re: Exception Safe Programming

Daniel Keep daniel.keep.lists at gmail.com
Sun Feb 25 15:59:52 PST 2007

Saaa wrote:
> I was that far myself :)
> It is that I can list everything in that dir when that line is commented out
> (everything working fine)
> I too found the error a bit strange, but I thought I shouldn't complain :D
>> Saaa wrote:
>>> That is the whole code.. I've stripped it bare. Only a main calling that 
>>> function:
>>> void main()
>>> {
>>>  char[][] files;
>>>  getPictureList("pictures",files);
>>> }
>> Ah, I found the problem.  You're trying to list the contents of a 
>> directory that doesn't exist.  The error message isn't very clear, but 
>> that's the problem.  I don't know why commenting out the line with the 
>> throw is changing the behavior of the program, because it shouldn't. 

I've had some *really* bizarre problems with some Exceptions lately.  I
made the huge mistake of upgrading the D compiler when I had a working
project... spent a week trying to track down a weird bug only to
discover that for some reason, D was trying to memset 1.5GB of memory at
program startup, and then throwing Win32 exceptions every time I tried
to use a string as part of an Exception!

Tried to reduce it to a test case, but of course, I couldn't reproduce
the problem...  *grumble grumble*

Sorry, just needed to vent a little.  A week staring at assembler and
WinDbg only to discover D is doing something strange will do that :P

	-- Daniel

Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/

More information about the Digitalmars-d-learn mailing list