Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error messages now with file name and line number

0 views
Skip to first unread message

st...@stefp.dyndns.org

unread,
May 1, 2006, 6:08:47 PM5/1/06
to perl6-i...@perl.org
..with same format as gcc and grep. It is used by compiler-mode in
emacs for example.


$ diff -u compilers/imcc/debug.c.old compilers/imcc/debug.c
--- compilers/imcc/debug.c.old 2006-05-01 20:44:34.000000000 +0200
+++ compilers/imcc/debug.c 2006-05-02 00:03:03.000000000 +0200
@@ -11,7 +11,8 @@
IMCC_fatal(Interp *interp, int code, const char *fmt, ...)
{
va_list ap;
-
+ imcc_fprintf(interp, stderr, "%s:%d ", IMCC_INFO(interp)->state->file,
+ IMCC_INFO(interp)->state->line);
va_start(ap, fmt);
imcc_vfprintf(interp, stderr, fmt, ap);
va_end(ap);
@@ -24,8 +25,10 @@
{
va_list ap;

- va_start(ap, fmt);
+ imcc_fprintf(interp, stderr, "%s:%d ", IMCC_INFO(interp)->state->file,
+ IMCC_INFO(interp)->state->line);
fprintf(stderr, "error:imcc:");
+ va_start(ap, fmt);
imcc_vfprintf(interp, stderr, fmt, ap);
va_end(ap);
IMCC_print_inc(interp);
@@ -41,6 +44,8 @@
if (IMCC_INFO(interp)->imcc_warn)
return;

+ imcc_fprintf(interp, stderr, "%s:%d ", IMCC_INFO(interp)->state->file,
+ IMCC_INFO(interp)->state->line);
va_start(ap, fmt);
imcc_vfprintf(interp, stderr, fmt, ap);
va_end(ap);

0 new messages