digitalmars.D - format of error messages
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (18/18) Mar 19 2005 -----BEGIN PGP SIGNED MESSAGE-----
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (21/25) Mar 20 2005 GDC uses the same error format as GCC does,
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (21/56) Mar 20 2005 On second thought, using filters is probably overkill.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The format of the error messages are currently: gdc-0.10: dmd-118: Wouldn't it be realy usefull for both compilers to use the same format to denote source files and line nummers? Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) iD8DBQFCPSWR3w+/yD4P9tIRAicCAJsHqNjWVd5gIWZ9BeHlmTIxKfMf2wCgmqmB RaPxTG/SxmB7w+ZunyFNTVA= =NKBM -----END PGP SIGNATURE-----
Mar 19 2005
Thomas Kühne wrote:Wouldn't it be realy usefull for both compilers to use the same format to denote source files and line nummers?GDC uses the same error format as GCC does, maybe DMD just uses the DMC error format ? I guess the "dmd" wrapper script could also filter the compiler output to match ? Since they already take different arguments, I meant. (no real hope of making them the same) Now it uses: (this is Perl)my $result = system( cmd); signalThis can be changed to reroute the gdc STDOUT and STDERR, and then do some filtering on them ? (it would probably have to be done using pipes, to avoid waiting until it is done for any output...) Then use a regexp of something like s/^([\w\/\.]+)\:(\d+)\:/$1($2):/; To make "dmd" use the DMD error style, and "gdc" continue to use GCC style ? Another thing is that both compilers now use $DFLAGS, but that they have varying syntax for those params... $DC (=gdc) should probably use $DCFLAGS or something ? Since $DMD (=dmd) have already claimed $DFLAGS, I mean. --anders
Mar 20 2005
I guess the "dmd" wrapper script could also filter the compiler output to match ?[...]This can be changed to reroute the gdc STDOUT and STDERR, and then do some filtering on them ? (it would probably have to be done using pipes, to avoid waiting until it is done for any output...)On second thought, using filters is probably overkill. DMD: (mars.c)char *Loc::toChars() { OutBuffer buf; char *p; if (filename) { buf.printf("%s", filename); } if (linnum) buf.printf("(%d)", linnum); buf.writeByte(0); return (char *)buf.extractData(); }GDC: (gcc-mars.cc)char *Loc::toChars() { OutBuffer buf; if (filename) { buf.printf("%s", filename); } if (linnum) buf.printf(":%d", linnum); buf.writeByte(0); return (char *)buf.extractData(); }Seems like a better way here would be to add some kind of flag to GDC, to toggle how you want the error output ? And have it default to GCC-style for GDC, and then add a new "-ferror-style=dmd" (or something) param to the "dmd" wrapper ? Something like: if (linnum) { if (global.params.dmdErrorStyle) buf.printf("(%d)", linnum); else buf.printf(":%d", linnum); } The rest is up to David :-) --anders PS. Speaking of filters, a lot of the previous "dfilter" hacks are scheduled for inclusion in future Doxygen... (http://www.prowiki.org/wiki4d/wiki.cgi?DoxygenIssues)
Mar 20 2005