@kacejot

Есть ли какой-нибудь способ проверить выход из области видимости в C?

Собственно, мой вопрос довольно исчерпывающий. Нужно использовать для расширенного логирования входа и выхода из функций.
  • Вопрос задан
  • 225 просмотров
Решения вопроса 1
@MiiNiPaa
Если вас не пугают расширения GCC, то вот: https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Varia...

cleanup (cleanup_function)
The cleanup attribute runs a function when the variable goes out of scope. This attribute can only be applied to auto function scope variables; it may not be applied to parameters or variables with static storage duration. The function must take one parameter, a pointer to a type compatible with the variable. The return value of the function (if any) is ignored.


Ещё: https://en.wikipedia.org/wiki/Resource_acquisition...
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы