aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-01 16:48:43 +0000
committerGitHub <noreply@github.com>2021-06-01 16:48:43 +0000
commit6b91184a267e26b6235eedd3702aac0890804086 (patch)
tree40c2b9406232c6a263197f24207bef4756a75b19 /gcc
parent2a644a5ebb5e4b8f8dd52e5da1c87b73f2ae7f1b (diff)
parent40d74620519e1157a2008dbc06821dfda8b295da (diff)
downloadgcc-6b91184a267e26b6235eedd3702aac0890804086.zip
gcc-6b91184a267e26b6235eedd3702aac0890804086.tar.gz
gcc-6b91184a267e26b6235eedd3702aac0890804086.tar.bz2
Merge #463
463: Always print compiler debug info on stderr r=philberty a=CohenArthur I am starting my work on cargo-gccrs, and the output from the compiler messes with what cargo expects as output. Since much of the debug prints are already done on `stderr` instead of `stdout`, this PR fixes what I believe to be the few remaining cases using `stdout`. I used the following regexes (with ripgrep) to find all remaining instances of debug prints on `stdout`: `[^f]printf` and `fprintf \(stdout` Co-authored-by: CohenArthur <arthur.cohen@epita.fr>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/rust-session-manager.cc2
-rw-r--r--gcc/rust/typecheck/rust-tyty.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 6ed556a..2c4399e 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -456,7 +456,7 @@ Session::parse_files (int num_files, const char **files)
for (int i = 0; i < num_files; i++)
{
- printf ("Attempting to parse file: %s\n", files[i]);
+ fprintf (stderr, "Attempting to parse file: %s\n", files[i]);
parse_file (files[i]);
}
/* TODO: should semantic analysis be dealed with here? or per file? for now,
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index 5acc9e7..285ed1c 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -142,8 +142,8 @@ public:
void debug () const
{
- printf ("[%p] %s\n", static_cast<const void *> (this),
- debug_str ().c_str ());
+ fprintf (stderr, "[%p] %s\n", static_cast<const void *> (this),
+ debug_str ().c_str ());
}
protected:
@@ -319,7 +319,7 @@ public:
StructFieldType *clone () const;
- void debug () const { printf ("%s\n", as_string ().c_str ()); }
+ void debug () const { fprintf (stderr, "%s\n", as_string ().c_str ()); }
private:
HirId ref;