mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-27 05:00:15 +00:00
e42ec82219
Likewise use __builtin_LINE instead of __LINE__. When building C++, inline functions are required to have the exact same sequence of tokens in every translation unit. But __FILE__ token, when used in a header file, does not necessarily expand to the exact same string literal, and that may cause compilation failure when C++ modules are being used. (It would also cause unpredictable output on assertion failure at runtime, but this rarely matters in practice.) For example, given the following sources: // a.h #include <assert.h> inline void fn () { assert (0); } // a.cc #include "a.h" // b.cc #include "foo/../a.h" preprocessing a.cc will yield a call to __assert_fail("0", "a.h", ...) but b.cc will yield __assert_fail("0", "foo/../a.h", ...) |
||
---|---|---|
.. | ||
__assert.c | ||
__libc_assert_fail.c | ||
assert-perr.c | ||
assert.c | ||
assert.h | ||
Depend | ||
Makefile | ||
test-assert-perr.c | ||
test-assert.c | ||
tst-assert-c++.cc | ||
tst-assert-g++.cc | ||
Versions |