diff options
| author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-27 16:20:45 +0000 |
|---|---|---|
| committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-27 16:20:45 +0000 |
| commit | 997731ebf296794b863c463e4eb2a42b78d179f4 (patch) | |
| tree | e2fce412e85b16b97075f73dc19c83b703a40a39 /gcc/system.h | |
| parent | b8a891cb5d4cde1adc1ab977b39c3cbab2dc9c28 (diff) | |
| download | ppe42-gcc-997731ebf296794b863c463e4eb2a42b78d179f4.tar.gz ppe42-gcc-997731ebf296794b863c463e4eb2a42b78d179f4.zip | |
* configure.ac: Add ENABLE_ASSERT_CHECKING control.
Add is_release variable, use it for --enable-werror and
--enable-checking defaults.
* system.h (gcc_assert, gcc_unreachable): New.
* doc/install.texi (--enable-checking): Update.
* configure, config.in: Rebuilt.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86666 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/system.h')
| -rw-r--r-- | gcc/system.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h index 14dd1de4bcd..934a332162f 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -505,6 +505,19 @@ extern int snprintf (char *, size_t, const char *, ...); extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) +/* Use gcc_assert(EXPR) to test invariants. */ +#if ENABLE_ASSERT_CHECKING +#define gcc_assert(EXPR) \ + ((void)(__builtin_expect (!(EXPR), 0) \ + ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) +#else +#define gcc_assert(EXPR) ((void)0) +#endif + +/* Use gcc_unreachable() to mark unreachable locations (like an + unreachable default case of a switch. Do not use gcc_assert(0). */ +#define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__)) + /* Provide a fake boolean type. We make no attempt to use the C99 _Bool, as it may not be available in the bootstrap compiler, and even if it is, it is liable to be buggy. |

