lua-users home
lua-l archive

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


> 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