diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index 3d13c90c4b..5b338f886f 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -421,6 +421,15 @@ virBufferVasprintf(virBufferPtr buf, const char *format, va_list argptr) 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 + * 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: * @buf: the buffer to append to @@ -535,15 +544,6 @@ virBufferEscapeSexpr(virBufferPtr buf, virBufferEscape(buf, '\\', "\\'", format, str); } -/* Work around spurious strchr() diagnostics given by -Wlogical-op - * 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 - /** * virBufferEscape: * @buf: the buffer to append to