While doing a bug report for CUDA's compiler, I ended up finding this strange behavior with gcc's preprocessing step. I currently use gcc 4.8.2.
Test file: test.cpp
#include <assert.h>
int main()
{
int a = 1;
assert (a >= 0);
assert (a
>= 0);
}
Command
gcc -E -x c++ -m64 -g -o "test.cpp4.ii" "test.cpp"
Result file: test.cpp4.ii
# 2 "test.cpp" 2
int main()
{
int a = 1;
((a >= 0) ? static_cast<void> (0) : __assert_fail ("a >= 0", "test.cpp", 6, __PRETTY_FUNCTION__));
((a >= 0) ? static_cast<void> (0) : __assert_fail ("a >= 0",
"test.cpp"
# 7 "test.cpp" 3 4
,
8
# 7 "test.cpp" 3 4
, __PRETTY_FUNCTION__))
;
The multiline assert seems to be processed differently, leading to these # 7 "test.cpp" 3 4
lines. What does that mean exactly?
Update
Apparently, gcc 4.7 gives # 7 "test.cpp"
(without the last 2 numbers).