On Thu Mar 9 09:30:49 2023 +0000, Alexandre Julliard wrote:
The last patch is introducing a warning:
i686-w64-mingw32-gcc -c -o dlls/kernelbase/i386-windows/registry.o dlls/kernelbase/registry.c -Idlls/kernelbase -Iinclude \ -Iinclude/msvcrt -D_MSVCR_VER=0 -D__WINESRC__ -DWINBASEAPI= -DWINADVAPI= -DWINUSERAPI= \ -DWINSHLWAPI= -D__WINE_PE_BUILD -Wall -fno-strict-aliasing -Wdeclaration-after-statement \ -Wempty-body -Wignored-qualifiers -Winit-self -Wno-packed-not-aligned -Wshift-overflow=2 \ -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith \ -Wlogical-op -Wabsolute-value -fno-omit-frame-pointer -gdwarf-4 -Werror -g -O2 -fno-diagnostics-show-caret dlls/kernelbase/registry.c: In function ‘create_key’: dlls/kernelbase/registry.c:262:26: error: storing the address of local variable ‘str’ in ‘*attr.ObjectName’ [-Werror=dangling-pointer=] dlls/kernelbase/registry.c:259:24: note: ‘str’ declared here dlls/kernelbase/registry.c:259:24: note: ‘attr’ declared here cc1: all warnings being treated as errors make: *** [Makefile:68674: dlls/kernelbase/i386-windows/registry.o] Error 1
That's very strange since I didn't modify these lines of code, so I'd expect the warning to also be there before any of my patches. I also don't see the warning locally.
I do get rid of this code later in my patch series. Fixing it earlier will create a mess since attr is currently used everywhere, but I guess it could be done. Since I don't see the warning it may be difficult to do without introducing it again in intermediate commits.