D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 64 - Unhandled errors should go to stderr
Summary: Unhandled errors should go to stderr
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D1 (retired)
Hardware: All All
: P1 major
Assignee: Walter Bright
URL: http://www.digitalmars.com/pnews/read...
Keywords: diagnostic, EH, patch
Depends on:
Blocks:
 
Reported: 2006-03-22 05:24 UTC by Stewart Gordon
Modified: 2014-02-15 13:16 UTC (History)
0 users

See Also:
smjg: d1.0blocker? (bugzilla)


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stewart Gordon 2006-03-22 05:24:00 UTC
When an exception is thrown and the application doesn't handle it, the default handler outputs the error message to stdout.  This is wrong.  It should go to stderr.  That's exactly what stderr's there for.

Walter once claimed that he doesn't really like stderr, apparently because versions of Windows prior to 2000 don't provide a means of redirecting it.  I have debunked this excuse at least three times over:

1. By pointing out that the spec states that "the program gracefully exits through the default error handler with an appropriate message".  Redirecting error output when the user didn't ask for it, be it to a file, a filter or a program such as Doxygen, is most ungraceful.

2. By stating that whether to redirect errors along with normal output should be up to the user, not the programmer, and certainly not the creator of the language that the program is written in.

3. By writing Rederr and releasing it on digitalmars.D.announce:

http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.announce/1518


The fix was written ages ago:

http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/4368
Comment 1 Brad Roberts 2006-03-23 01:23:07 UTC
Sorry, choice of stdout vs stderr for the last ditch catch isnt:

Critical  	crashes, loss of data, severe memory leak
P1	so bad that an update needs to happen immediately; i.e. it makes D unusable

I've lowered it back to normal and P2.

I do agree that stderr is more appropriate.
Comment 2 Stewart Gordon 2006-03-23 04:22:06 UTC
Sorry, I was thinking of it as silent generation of bad code, which Walter once suggested should count as critical.  Should've finished reading that discussion I guess....
Comment 3 Stewart Gordon 2006-09-10 19:07:10 UTC
The fix is now here:

http://www.digitalmars.com/d/archives/digitalmars/D/bugs/3170.html

May I propose an alternative meaning for P1 - namely "The fix has been written and should be folded in right now"?
Comment 4 Stewart Gordon 2006-09-14 18:03:03 UTC
That was the thread with the fix to remove Object.print and the implicitly imported printf, with a follow-on fix for this.  The fix that just fixes this bug is, of course, at

http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=4368
Comment 5 Stewart Gordon 2006-12-05 16:04:31 UTC
(In reply to comment #3)
> May I propose an alternative meaning for P1 - namely "The fix has been written
> and should be folded in right now"?

No reply => going for it.  Time's too short to waste any more.
Comment 6 Walter Bright 2007-03-29 19:04:03 UTC
Fixed DMD 1.010
Comment 9 github-bugzilla 2012-05-11 19:02:58 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a8ffc8ab60aa3e1ae965e5764f0900e14a0881c1
Fix issue 7546 64-bit floating-point issue with negative zero: -0.0 == 0.0 is false

Just duplicate the code for float == float.