Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
spin_lock(m_lock);
old_head = m_head;
if(m_head != NULL)
m_head = m_head->next;
spin_unlock(m_lock);
for (int i = 0; i >= 0; ++ i)
{
if (i % 1000000000 == 0) printf("%d\n", i);
}
If during the evaluation of an expression, the result is not mathematically defined or not in the range of representable values for its type, the behavior is undefined.
Unsigned integers, declared unsigned, shall obey the laws of arithmetic modulo 2^n where n is the number of bits in the value representation of that particular size of integer.
-Wstrict-overflow=1. В крайнем случае, предупреждению точно есть место среди пяти уровней -Wstrict-overflow. Вечером поищу багрепорты/рассылки на эту тему, т. к. надо бы добавить предупреждение../a.cpp:1: error: expected unqualified-id before ‘for’
./a.cpp:1: error: expected constructor, destructor, or type conversion before ‘>=’ token
./a.cpp:1: error: expected unqualified-id before ‘++’ token</code>
Частые ошибки при разработке lockfree-алгоритмов и их решения