Re: [PATCH] build: avoid warnings on older gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/15/2012 09:24 AM, Viktor Mihajlovski wrote:
> On 08/15/2012 12:42 AM, Eric Blake wrote:
>> The previous patch pulled in a newer version of stat-time.h from
>> gnulib, which tries to suppress some stupid gcc warnings (see
>> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>) by exploiting
>> a feature of newer gcc.  But we still aim to compile on RHEL 6.3,
>> with gcc 4.4.6 (not to mention even older devel platforms like
>> RHEL 5), which fails to build thanks to our development -Werror.
>>

>> +++ b/m4/virt-compile-warnings.m4
>> @@ -58,6 +58,23 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
>>       # Gnulib's stat-time.h violates this
>>       dontwarn="$dontwarn -Waggregate-return"
>>
>> +    # Gnulib uses '#pragma GCC diagnostic push' to silence some
>> +    # warnings, but older gcc doesn't support this.
>> +    AC_CACHE_VAL([lv_cv_gcc_pragma_push_works], [

I want to use AC_CACHE_CHECK instead of AC_CACHE_VAL anyways, so I'll
send a v2.

>> +      save_CFLAGS=$CFLAGS
>> +      CFLAGS=-Wunknown-pragmas

If you change this line, does it help?

CFLAGS='-Wunknown-pragmas -Werror'

> Hi Eric,
> 
> I assume this was intended to suppress errors like this here:
> 
>   CC     libvirt_driver_storage_la-storage_backend.lo
> cc1: warnings being treated as errors
> In file included from ../../src/storage/storage_backend.c:59:
> ../../gnulib/lib/stat-time.h:55: error: no previous prototype for
> 'get_stat_atime_ns' [-Wmissing-prototypes]

Yep.  And I need to mention that in my commit message.

> unfortunately, even applying the patch above and rerunning bootstrap,
> configure, make didn't help and I'm still getting the errors ... the
> interesting thing is that pragma push seems to work...
> I am compiling on RHEL6.2, gcc 4.4.6

I'm still investigating why it worked for me.  I may have had a stale
config.cache interfering with what I posted vs. what I tested earlier.
Look for a v2 soon.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]