mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
build: cleanup GCC < 4.6 -Wlogical-op workaround
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
16b41728b5
commit
7fb81831fc
@ -236,7 +236,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
|
|||||||
|
|
||||||
if test "$gl_cv_warn_c__Wlogical_op" = yes &&
|
if test "$gl_cv_warn_c__Wlogical_op" = yes &&
|
||||||
test "$lv_cv_gcc_wlogical_op_broken" = yes; then
|
test "$lv_cv_gcc_wlogical_op_broken" = yes; then
|
||||||
AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP], 1,
|
AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP_STRCHR], 1,
|
||||||
[Define to 1 if gcc -Wlogical-op reports false positives on strchr])
|
[Define to 1 if gcc -Wlogical-op reports false positives on strchr])
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
@ -253,6 +253,16 @@
|
|||||||
# define VIR_WARNINGS_RESET
|
# define VIR_WARNINGS_RESET
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/* Workaround bogus GCC < 4.6 that produces false -Wlogical-op warnings for
|
||||||
|
* strchr(). Those old GCCs don't support push/pop. */
|
||||||
|
# if BROKEN_GCC_WLOGICALOP_STRCHR
|
||||||
|
# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR \
|
||||||
|
_Pragma ("GCC diagnostic ignored \"-Wlogical-op\"")
|
||||||
|
# else
|
||||||
|
# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use this when passing possibly-NULL strings to printf-a-likes.
|
* Use this when passing possibly-NULL strings to printf-a-likes.
|
||||||
*/
|
*/
|
||||||
|
@ -417,14 +417,9 @@ virBufferVasprintf(virBufferPtr buf, const char *format, va_list argptr)
|
|||||||
buf->use += count;
|
buf->use += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Work around spurious strchr() diagnostics given by -Wlogical-op
|
|
||||||
* for gcc < 4.6. Doing it via a local pragma keeps the damage
|
VIR_WARNINGS_NO_WLOGICALOP_STRCHR
|
||||||
* smaller than disabling it on the package level. Unfortunately, the
|
|
||||||
* affected GCCs don't allow diagnostic push/pop which would have
|
|
||||||
* further reduced the impact. */
|
|
||||||
#if BROKEN_GCC_WLOGICALOP
|
|
||||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virBufferEscapeString:
|
* virBufferEscapeString:
|
||||||
|
@ -989,14 +989,7 @@ virStringHasControlChars(const char *str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Work around spurious strchr() diagnostics given by -Wlogical-op
|
VIR_WARNINGS_NO_WLOGICALOP_STRCHR
|
||||||
* for gcc < 4.6. Doing it via a local pragma keeps the damage
|
|
||||||
* smaller than disabling it on the package level. Unfortunately, the
|
|
||||||
* affected GCCs don't allow diagnostic push/pop which would have
|
|
||||||
* further reduced the impact. */
|
|
||||||
#if BROKEN_GCC_WLOGICALOP
|
|
||||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -428,17 +428,8 @@ virSysinfoRead(void)
|
|||||||
|
|
||||||
|
|
||||||
#elif defined(__s390__) || defined(__s390x__)
|
#elif defined(__s390__) || defined(__s390x__)
|
||||||
/*
|
|
||||||
we need to ignore warnings about strchr caused by -Wlogical-op
|
VIR_WARNINGS_NO_WLOGICALOP_STRCHR
|
||||||
for some GCC versions.
|
|
||||||
Doing it via a local pragma keeps the damage smaller than
|
|
||||||
disabling it on the package level.
|
|
||||||
Unfortunately, the affected GCCs don't allow diagnostic push/pop
|
|
||||||
which would have further reduced the impact.
|
|
||||||
*/
|
|
||||||
# if BROKEN_GCC_WLOGICALOP
|
|
||||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
virSysinfoParseDelimited(const char *base, const char *name, char **value,
|
virSysinfoParseDelimited(const char *base, const char *name, char **value,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user