mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
Conditionalize use of -Wno-suggest-attribute=format pragma
Many GCC versions don't understand -Wno-suggest-attribute=format so the pragma must only be used when supported
This commit is contained in:
parent
29f15b43fa
commit
87fa184910
@ -215,6 +215,12 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
|
||||
;;
|
||||
esac
|
||||
|
||||
case $WARN_CFLAGS in
|
||||
*-Wsuggest-attribute=format*)
|
||||
AC_DEFINE([HAVE_SUGGEST_ATTRIBUTE_FORMAT], [1], [Whether -Wsuggest-attribute=format works])
|
||||
;;
|
||||
esac
|
||||
|
||||
# Silence certain warnings in gnulib, and use improved glibc headers
|
||||
AC_DEFINE([lint], [1],
|
||||
[Define to 1 if the compiler is checking for lint.])
|
||||
|
@ -234,9 +234,15 @@
|
||||
# define VIR_WARNINGS_NO_CAST_ALIGN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wcast-align\"")
|
||||
# define VIR_WARNINGS_NO_PRINTF \
|
||||
|
||||
# if HAVE_SUGGEST_ATTRIBUTE_FORMAT
|
||||
# define VIR_WARNINGS_NO_PRINTF \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
|
||||
# else
|
||||
# define VIR_WARNINGS_NO_PRINTF \
|
||||
_Pragma ("GCC diagnostic push")
|
||||
# endif
|
||||
|
||||
# define VIR_WARNINGS_RESET \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
|
Loading…
Reference in New Issue
Block a user