MAINT: move variable attribute checks into a common variable

also rename GCC_ATTRIBUTES to FUNCTION_ATTRIBUTES