mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-28 12:13:37 +08:00
e077349ce5
* assert/assert.h (assert): Rewrite assert's definition so that a s/==/=/ typo, e.g., assert(errno = ENOENT) is not hidden from gcc's -Wparentheses by assert-added parentheses. The new definition uses "if (expr) /* empty */; else __assert_fail...", so gcc -Wall will now detect that type of error in an assert, too. The __STRICT_ANSI__ disjunct is to make this work also with both -ansi and -pedantic, which would reject the use of ({...}). I would have preferred to use __extension__ to mark that, but doing so would mistakenly suppress warnings about any extension in the user-supplied "expr". E.g., "assert ( ({1;}) )" must continue to evoke a warning. |
||
---|---|---|
.. | ||
__assert.c | ||
assert-perr.c | ||
assert.c | ||
assert.h | ||
Depend | ||
Makefile | ||
test-assert-perr.c | ||
test-assert.c | ||
Versions |