summaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib/eprintf.c
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2000-02-17 19:39:46 +0000
committerChristopher Faylor <cgf@redhat.com>2000-02-17 19:39:46 +0000
commit6d491d8ad9122891d1a48447e8c49702eb678921 (patch)
tree45619a131b9f211ceca9fce7a866328344bf00ec /newlib/libc/stdlib/eprintf.c
parentbd592806f45307757c24ec3f75bdefe13abfd51f (diff)
downloadgdb-cvs/SNAPSHOT.tar.gz
import newlib-2000-02-17 snapshotcvs/SNAPSHOT
Diffstat (limited to 'newlib/libc/stdlib/eprintf.c')
-rw-r--r--newlib/libc/stdlib/eprintf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/eprintf.c b/newlib/libc/stdlib/eprintf.c
new file mode 100644
index 00000000000..46cf8104be2
--- /dev/null
+++ b/newlib/libc/stdlib/eprintf.c
@@ -0,0 +1,26 @@
+/* This is an implementation of the __eprintf function which is
+ compatible with the assert.h which is distributed with gcc.
+
+ This function is provided because in some cases libgcc.a will not
+ provide __eprintf. This will happen if inhibit_libc is defined,
+ which is done because at the time that libgcc2.c is compiled, the
+ correct <stdio.h> may not be available. newlib provides its own
+ copy of assert.h, which calls __assert, not __eprintf. However, in
+ some cases you may accidentally wind up compiling with the gcc
+ assert.h. In such a case, this __eprintf will be used if there
+ does not happen to be one in libgcc2.c. */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+void
+__eprintf (format, file, line, expression)
+ const char *format;
+ const char *file;
+ unsigned int line;
+ const char *expression;
+{
+ (void) fiprintf (stderr, format, file, line, expression);
+ abort ();
+ /*NOTREACHED*/
+}