Inconsistent error/warning messages

Steve Teale steve.teale at britseyeview.com
Thu Dec 31 05:13:10 PST 2009


DMD/GCD (1.30) produce error/warning messages that are not consistent. For example, if there is an error, with DMD you see:

fixups.d(50): unrecognized declaration

but for a warning:

warning - fixups.d(37): Error: implicit conversion of expression (atoi(t)) of type long to int can cause loss of data

(GDC uses another colon and no parentheses for the line number.)

The first case, which is an error, does not contain the word error, but the second, which isn't, does.

I think this makes life difficult for IDEs that parse the compiler output. For example, in Code::Blocks, the file name in the message window appears as 'warning - fixups.d', the message is shown as an error, and the error/warning counts are incorrect. It also screws up the ability to click on the message and have the editor jump to the indicated line number, and marking of error/warning lines. There might be similar problems with debuggers.

The GCC C compiler in contrast produces error and warning messages as follows:

hello.c:13: error: expected expression before '}' token
hello.c:13: warning: control reaches end of non-void function

Disambiguation and structure in this case are quite clear.

Also, many IDEs report both the number of errors and the number of warnings. This can't work with D and a message parsing IDE, since when you specify error reporting

dmd -w -c x.d
gdc -Wall -c x.d

if there are errors you only see the errors, even though there are preceding points in the code that should produce warnings. GCC C behaves the same in this respect, so it may be a hallowed tradition.

Are these bugs?




More information about the Digitalmars-d mailing list