diff options
author | Michael Meissner <meissner@cygnus.com> | 1998-04-27 08:49:53 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 1998-04-27 08:49:53 +0000 |
commit | 22c4957e6b744aed9b442a6e0075fbb70f469b47 (patch) | |
tree | 2ed7d0789f9ba1f4d88b4964a3f3e56422310726 /gcc/system.h | |
parent | 563c063f761d5f25fe0cb3821f36f9635b9832b3 (diff) | |
download | gcc-22c4957e6b744aed9b442a6e0075fbb70f469b47.zip gcc-22c4957e6b744aed9b442a6e0075fbb70f469b47.tar.gz gcc-22c4957e6b744aed9b442a6e0075fbb70f469b47.tar.bz2 |
Redefine abort to report linenumber and filename of the error
From-SVN: r19423
Diffstat (limited to 'gcc/system.h')
-rw-r--r-- | gcc/system.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h index 6e8548e..e381c2d 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -188,4 +188,33 @@ extern void free (); extern char *getenv (); #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__ */ + +#ifndef USE_SYSTEM_ABORT +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +#define abort() \ +(fprintf (stderr, \ + "%s:%d: Internal compiler error\n", __FILE__, __LINE__), \ + exit (FATAL_EXIT_CODE)) + +#else +#define abort() \ +(fprintf (stderr, \ + "%s:%d: Internal compiler error in function %s\n", \ + __FILE__, __LINE__, __PRETTY_FUNCTION__), \ + exit (FATAL_EXIT_CODE)) + +#endif /* recent gcc */ +#endif /* !USE_SYSTEM_ABORT */ +#endif /* !abort */ + #endif /* __GCC_SYSTEM_H__ */ |