emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs pretest 28.1.90 is out


From: Eli Zaretskii
Subject: Re: Emacs pretest 28.1.90 is out
Date: Fri, 01 Jul 2022 13:59:25 +0300

> From: Arash Esbati <arash@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 01 Jul 2022 09:15:43 +0200
> 
> Stefan Kangas <stefan@marxist.se> writes:
> 
> > The first pretest for what will be the 28.2 release of Emacs (the
> > extensible text editor) is available at:
> >
> >   https://alpha.gnu.org/gnu/emacs/pretest/emacs-28.1.90.tar.xz
> 
> Thanks, builds fine on Win10 with Mingw64 (I ran only ./configure and
> make).  I get only these warnings:
> 
>   CCLD     make-docfile.exe
>   CCLD     make-fingerprint.exe
> In function 'main':
> cc1.exe: warning: '__builtin_memcpy' writing 12 bytes into a region of size 
> between 0 and 7 [-Wstringop-overflow=]
> In file included from ctags.c:2:
> etags.c:1429:21: note: destination object of size [0, 7] allocated by 
> 'xmalloc'
>  1429 |         char *cmd = xmalloc (2 * strlen (tagfile) + sizeof "sort -u 
> -o..");
>       |                     
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Does anyone understand why it says "size [0, 7]"?  The result sizeof
should yield 13, so even if GCC considers the case of strlen returning
zero, the result should be at least 13.  In my case (GCC 9.3)
disassembly of the 'main' function shows that indeed the code calls
strlen and then adds 13 to its result.

There are quite a few hits for -Wstringop-overflow on the Internet, so
maybe this is a GCC bug?  Maybe you should downgrade to a GCC whose
version is not XX.1.0.

I see nothing wrong with that code, FWIW.



reply via email to

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