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: Eli Zaretskii
Subject: Re: Warnings in mingw64 builds on master
Date: Mon, 17 Aug 2020 19:21:39 +0300

> Cc: andrewjmoreton@gmail.com, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 16 Aug 2020 21:21:36 -0700
> 
> On 8/16/20 8:39 AM, Eli Zaretskii wrote:
> > the warning it emits has nothing to
> > do with correctness of the code.
> 
> I'm not sure I follow. Although it's true that adding __attribute__ 
> ((malloc)) 
> does not turn formerly-incorrect code into correct code, the same thing is 
> true 
> of other function attributes like _Noreturn. But that doesn't mean we 
> shouldn't 
> use function attributes.

Agreed.  I'm not against function attributes in general or
__attribute__((malloc)) in particular.

> This is not simply a matter of memcpy vs memmove. In C one must constantly 
> worry 
> about aliasing. These worries are lessened with __attribute__ ((malloc)), so 
> the 
> attribute is typically a win.

Agreed.  I was talking about the compiler option
"-Wsuggest-attribute=malloc", not about using the function attributes
in our code.  I think including -Wsuggest-attribute=malloc in the
"normal" build just risks raising the noise level for no good reason.

So with that in mind, I went ahead and moved this warning into the set
used when --enable-gcc-warnings.



reply via email to

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