Fix pragma GCC diagnostic not allowed inside functions.