summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-09 16:42:40 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-09 16:42:40 +0000
commit5598d0fc73422b49ab8cae81723ad2917f536ab3 (patch)
tree9e6dce1f153849259a29e4ba755f26fe7d83624a /libgo
parentd09332fc3f7b7ba5712b5746f7b1f1e896557e61 (diff)
downloadgcc-5598d0fc73422b49ab8cae81723ad2917f536ab3.tar.gz
runtime: make print() built-in write to stderr.
Fixes issue 2294. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-print.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libgo/runtime/go-print.c b/libgo/runtime/go-print.c
index 095909de2bf..bf3c2af7128 100644
--- a/libgo/runtime/go-print.c
+++ b/libgo/runtime/go-print.c
@@ -18,43 +18,43 @@
void
__go_print_space ()
{
- putchar (' ');
+ putc (' ', stderr);
}
void
__go_print_nl ()
{
- putchar ('\n');
+ putc ('\n', stderr);
}
void
__go_print_string (struct __go_string val)
{
- printf ("%.*s", (int) val.__length, (const char *) val.__data);
+ fprintf (stderr, "%.*s", (int) val.__length, (const char *) val.__data);
}
void
__go_print_uint64 (uint64_t val)
{
- printf ("%llu", (unsigned long long) val);
+ fprintf (stderr, "%llu", (unsigned long long) val);
}
void
__go_print_int64 (int64_t val)
{
- printf ("%lld", (long long) val);
+ fprintf (stderr, "%lld", (long long) val);
}
void
__go_print_double (double val)
{
- printf ("%.24g", val);
+ fprintf (stderr, "%.24g", val);
}
void
__go_print_complex (__complex double val)
{
- printf ("(%.24g%s%.24gi)",
+ fprintf (stderr, "(%.24g%s%.24gi)",
__builtin_creal (val),
(__builtin_cimag (val) >= 0 || __builtin_isnan (__builtin_cimag(val))
? "+"
@@ -65,29 +65,29 @@ __go_print_complex (__complex double val)
void
__go_print_bool (_Bool val)
{
- fputs (val ? "true" : "false", stdout);
+ fputs (val ? "true" : "false", stderr);
}
void
__go_print_pointer (void *val)
{
- printf ("%p", val);
+ fprintf (stderr, "%p", val);
}
void
__go_print_empty_interface (struct __go_empty_interface e)
{
- printf ("(%p,%p)", e.__type_descriptor, e.__object);
+ fprintf (stderr, "(%p,%p)", e.__type_descriptor, e.__object);
}
void
__go_print_interface (struct __go_interface i)
{
- printf ("(%p,%p)", i.__methods, i.__object);
+ fprintf (stderr, "(%p,%p)", i.__methods, i.__object);
}
void
__go_print_slice (struct __go_open_array val)
{
- printf ("[%d/%d]%p", val.__count, val.__capacity, val.__values);
+ fprintf (stderr, "[%d/%d]%p", val.__count, val.__capacity, val.__values);
}