aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@rabi.columbia.edu>1999-04-16 19:52:44 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-04-16 19:52:44 +0000
commit2a611d21ac06af33998ac48328847e23ded6b59d (patch)
tree06e7f5db783744cf670101812a22a46a3d9482ea /gcc/system.h
parentbf69fb7efcf26ee27067c3225c8ce705ee357c5d (diff)
downloadgcc-2a611d21ac06af33998ac48328847e23ded6b59d.zip
gcc-2a611d21ac06af33998ac48328847e23ded6b59d.tar.gz
gcc-2a611d21ac06af33998ac48328847e23ded6b59d.tar.bz2
system.h: Always prototype abort.
1999-04-16 22:44 -0400 Zack Weinberg <zack@rabi.columbia.edu> * system.h: Always prototype abort. Prototype fatal. Define abort to call fatal, not fprintf/exit. Define a stub macro for trim_filename. * toplev.c: Define DIR_SEPARATOR. (trim_filename): New function. * toplev.h: Prototype trim_filename, and #undef system.h's stub. * gcc.c, genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c: Make fatal non-static. * gcov.c, gengenrtl.c, protoize.c: #undef abort after including system.h. * config/i386/dgux.h, config/m68k/xm-amix.h: Remove stale code relating to abort. From-SVN: r26511
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h45
1 files changed, 16 insertions, 29 deletions
diff --git a/gcc/system.h b/gcc/system.h
index cdd2bac..3ec73a6 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -378,40 +378,27 @@ extern int setrlimit ();
#endif
/* Redefine abort to report an internal error w/o coredump, and reporting the
- location of the error in the source file. */
-#ifndef abort
-#ifndef __STDC__
-#ifndef __GNUC__
-#ifndef USE_SYSTEM_ABORT
-#define USE_SYSTEM_ABORT
-#endif /* !USE_SYSTEM_ABORT */
-#endif /* !__GNUC__ */
-#endif /* !__STDC__ */
-
-#ifdef USE_SYSTEM_ABORT
-# ifdef NEED_DECLARATION_ABORT
+ location of the error in the source file.
+ Some files undefine abort again, so we must prototype the real thing
+ for their sake. */
+#ifdef NEED_DECLARATION_ABORT
extern void abort ();
-# endif
-#else
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#define abort() \
-(fprintf (stderr, \
- "%s:%d: Internal compiler error\n", __FILE__, __LINE__), \
- exit (FATAL_EXIT_CODE))
+#endif
+extern void fatal PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#define abort() fatal ("Internal compiler error at %s:%d\n", \
+ trim_filename (__FILE__), __LINE__)
#else
-#define abort() \
-(fprintf (stderr, \
- "%s:%d: Internal compiler error in function %s\n" \
- "Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.\n" \
- "See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.\n", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__), \
- exit (FATAL_EXIT_CODE))
-
+#define abort() fatal ("Internal compiler error in `%s', at %s:%d\n" \
+ "Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.\n" \
+ "See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.", \
+ __PRETTY_FUNCTION__, trim_filename (__FILE__), __LINE__)
#endif /* recent gcc */
-#endif /* USE_SYSTEM_ABORT */
-#endif /* !abort */
+/* trim_filename is in toplev.c. Define a stub macro for files that
+ don't link toplev.c. toplev.h will reset it to the real version. */
+#define trim_filename(x) (x)
/* Define a STRINGIFY macro that's right for ANSI or traditional C.
HAVE_CPP_STRINGIFY only refers to the stage1 compiler. Assume that