lwp: Ignore dangling-pointer warning in process.c
In lwp/process.c the address of a stack variable is saved as part of
creating a new context. GCC-12 is flagging the statement with a
diagnostic:
./process.c:46:24: error: storing the address of local variable
‘stackvar’ in ‘*savearea.topstack’ [-Werror=dangling-pointer=]
46 | savearea->topstack = (char *)&stackvar;
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In this particular case, the code is meaning to save the address of the
stack in preparation of setting up a new context, which requires knowing
the address the current stack.
The diagnostic is changed from a warning to an error when configured
with --enable-checking.
Set the env variable CFLAGS_NODANGLING_POINTER to
'-Wno-dangling-pointer' if the compiler supports the option and update
the src/lwp/Makefile.in to use the flag when compiling process.c
Change-Id: Ibec956b505c0edad9b74d63b9bb7805f6f0cba01
Reviewed-on: https://gerrit.openafs.org/14957
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>