предположение что название глобальной переменной err или error в некоторых случаях приводит к конфликту имен
|
Запускаем в варианте "static smd::sgz::err_c err;" и смотрим что говорит gdb:
Thread 2 "java" hit Breakpoint 1, __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at src/test/test.cpp:8
8 static smd::sgz::err_c err;
(gdb) print err
$1 = {mLast = ""}
(gdb) explore err
The value of 'err' is a struct/class of type 'smd::sgz::err_c' with the following fields:
mLast = <Enter 0 to explore this field of type 'std::__cxx11::string'>
Enter the field number of choice:
Вполне ожидаемо.
Теперь запускаем в варианте "smd::sgz::err_c err;":
Thread 2 "java" hit Breakpoint 1, __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at src/test/test.cpp:8
8 smd::sgz::err_c err;
(gdb) print err
$1 = {void (int, const char *, ...)} 0x7ffff7902fe0 <err>
(gdb) explore err
Explorer for type 'void (int, const char *, ...)' not yet available.
Внезапно под идентификатором err подразумевается какая-то функция.
Видимо источник бага в этом.