[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compiling lua-5.4.2 using Cygwin gcc 10.2.0: In function ‘str_unpack’: lstrlib.c:1722:18: warning: ‘u.n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 17 Dec 2020 15:50:25 -0300
> On a Windows 7 machine running 32-bit Cygwin
>
> [...]
>
> when compiling lua-5.4.2, I get the following:
>
> > $ make generic
> > ...
> > gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -c -o lstrlib.o lstrlib.c
> > lstrlib.c: In function ‘str_unpack’:
> > lstrlib.c:1722:18: warning: ‘u.n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> > 1722 | else num = u.n;
This is a problem of gcc trying (unsuccessfully) to be too smart :-(
Its documentation is explicit about that issue:
-Wmaybe-uninitialized
[...]
These warnings are made optional because GCC may not be able to
determine when the code is correct in spite of appearing to have an
error.
Despite this disclaimer, this option is enabled by -Wall.
-- Roberto