emacs-devel
[Top][All Lists]
Advanced

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

Re: Warnings in mingw64 builds on master


From: Óscar Fuentes
Subject: Re: Warnings in mingw64 builds on master
Date: Sat, 15 Aug 2020 22:36:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andy Moreton <andrewjmoreton@gmail.com>
>> Date: Sat, 15 Aug 2020 19:48:56 +0100
>> 
>> >> C:/emacs/git/emacs/master/src/w32reg.c:146:1: warning: function might be
>> >> candidate for attribute 'malloc' [-Wsuggest-attribute=malloc]
>> >>   146 | w32_get_string_resource (void *v_rdb, const char *name, const 
>> >> char *class)
>> >>       | ^~~~~~~~~~~~~~~~~~~~~~~
>> >
>> > That's just noise.  There's nothing wrong with the code.
>> 
>> Agreed. However it is better to have a clean build than to have
>> pointless warnings, so the real errors stand out.
>
> I'd rather we removed -Wsuggest-attribute=malloc from the options we
> use.
>> >> C:/emacs/git/emacs/master/src/w32.c: In function '_sys_read_ahead':
>> >> C:/emacs/git/emacs/master/src/w32.c:8785:10: warning: 'rc' may be used 
>> >> uninitialized in this function [-Wmaybe-uninitialized]
>> >>  8785 |   if (rc == sizeof (char))
>> >>       |       ~~~^~~~~~~~~~~~~~~~
>> >
>> > This is a bug in the compiler you are using: rc _is_ initialized.
>> 
>> The is "gcc version 10.2.0 (Rev1, Built by MSYS2 project)" so not
>> exactly old.
>
> Let's hope GCC 10.3 will fix this.

I'm half-asleep, so excuse me if I'm missing the obvious... but rc is
assigned or its address taken within conditional blocks, so if none of
those conditions are true, rc is not initialized at the warning site.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]