diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-02-07 18:59:28 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-02-07 18:59:28 +0200 |
commit | e0db6733fc8563896090f678d382375897757d18 (patch) | |
tree | b3810e2c34fe48b51de0e58a3d15e2b687558c4e /src | |
parent | 28da8cf2af6a181fd8a51613107415da3f07dd2e (diff) | |
download | cflow-e0db6733fc8563896090f678d382375897757d18.tar.gz cflow-e0db6733fc8563896090f678d382375897757d18.tar.bz2 |
Output debugging info to stderr instead of stdout.
Diffstat (limited to 'src')
-rw-r--r-- | src/c.l | 6 | ||||
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/parser.c | 30 |
3 files changed, 21 insertions, 19 deletions
@@ -1,3 +1,3 @@ /* This file is part of GNU cflow - Copyright (C) 1997, 2005, 2007, 2010 Sergey Poznyakoff + Copyright (C) 1997, 2005, 2007, 2010, 2014 Sergey Poznyakoff @@ -337,3 +337,3 @@ pp_open(const char *name) if (debug) - printf(_("Command line: %s\n"), s); + fprintf(stderr, _("Command line: %s\n"), s); fp = popen(s, "r"); @@ -476,3 +476,3 @@ update_loc() if (debug > 1) - printf(_("New location: %s:%d\n"), filename, line_num); + fprintf(stderr, _("New location: %s:%d\n"), filename, line_num); } @@ -745,3 +745,3 @@ init() - init_lex(debug > 1); + init_lex(debug > 2); init_parse(); @@ -753,3 +753,3 @@ const char version_etc_copyright[] = year. */ - "Copyright %s 2005, 2006, 2009, 2010, 2011 %d Sergey Poznyakoff"; + "Copyright %s 2005, 2006, 2009, 2010, 2011, 2014 %d Sergey Poznyakoff"; diff --git a/src/parser.c b/src/parser.c index bdb9e22..8dc2a4f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,3 +1,4 @@ /* This file is part of GNU cflow - Copyright (C) 1997, 2005, 2006, 2007, 2009, 2010, 2011, 2014 Sergey Poznyakoff + Copyright (C) 1997, 2005, 2006, 2007, 2009, 2010, 2011, + 2014 Sergey Poznyakoff @@ -173,7 +174,7 @@ dbgtok(TOKSTK *t, int delim) if (delim) - putchar(delim); - printf("{ %s ", token_type_str(t->type)); + fputc(delim, stderr); + fprintf(stderr, "{ %s ", token_type_str(t->type)); if (t->type) - printf(", %s, %d ", t->token ? t->token : "NULL", t->line); - putchar('}'); + fprintf(stderr, ", %s, %d ", t->token ? t->token : "NULL", t->line); + fputc('}', stderr); } @@ -189,5 +190,5 @@ debugtoken(TOKSTK *t, char *fmt, ...) va_start(ap, fmt); - vprintf(fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - printf(": "); + fprintf(stderr, ": "); } @@ -195,8 +196,8 @@ debugtoken(TOKSTK *t, char *fmt, ...) dbgtok(t, 0); - printf("; "); + fprintf(stderr, "; "); } - printf("%d: {", curs); + fprintf(stderr, "%d: {", curs); for (i = curs; i < tos; i++) dbgtok(token_stack + i, i == curs ? 0 : ','); - printf("}\n"); + fprintf(stderr, "}\n"); } @@ -219,4 +220,4 @@ mark(Stackpos pos) pos[0] = curs; - if (debug > 2) - printf("marking stack at %d\n", curs); + if (debug > 1) + fprintf(stderr, "marking stack at %d\n", curs); } @@ -1179,3 +1180,3 @@ declare(Ident *ident, int maybe_knr) if (debug) - printf(_("%s:%d: %s/%d defined to %s\n"), + fprintf(stderr, _("%s:%d: %s/%d defined to %s\n"), filename, @@ -1204,3 +1205,4 @@ declare_type(Ident *ident) if (debug) - printf(_("%s:%d: type %s\n"), filename, line_num, ident->name); + fprintf(stderr, _("%s:%d: type %s\n"), filename, line_num, + ident->name); } |