https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120621
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Note, if cbldiag.h would want to avoid including the 3 gcc headers, it could perhaps #if (CHECKING_P && GCC_VERSION >= 4001) || GCC_VERSION == BUILDING_GCC_VERSION #define ATTRIBUTE_GCOBOL_DIAG(m, n) __attribute__ ((__format__ (__gcc_tdiag__, m, n))) ATTRIBUTE_NONNULL(m) #else #define ATTRIBUTE_GCOBOL_DIAG(m, n) ATTRIBUTE_NONNULL(m) #endif and use ATTRIBUTE_GCOBOL_DIAG(1, 0) or (2, 0) etc. on the declarations instead of ATTRIBUTE_GCC_DIAG.