[PATCH 01/11] Remove unused and unsafe call to __builtin_frame_address
Corinna Vinschen
corinna-cygwin@cygwin.com
Sun Mar 20 10:54:00 GMT 2016
On Mar 19 13:45, Peter Foley wrote:
> initial_sp has been unused since commit fbf23e3 back in 2000.
> Keep the value, so as to avoid changing the offset of magic_biscuit.
>
> winsup/cygwin/lib/_cygwin_crt0_common.cc:140:52:
> error: calling 'void* __builtin_frame_address(unsigned int)' with a
> nonzero argument is unsafe [-Werror=frame-address]
> u->initial_sp = (char *) __builtin_frame_address (1);
>
> winsup/cygwin/ChangeLog
> lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize initial_sp
> with nullptr.
>
> Signed-off-by: Peter Foley <pefoley2@pefoley.com>
> ---
> winsup/cygwin/lib/_cygwin_crt0_common.cc | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc
> index 718ce94..96ebeee 100644
> --- a/winsup/cygwin/lib/_cygwin_crt0_common.cc
> +++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc
> @@ -135,9 +135,8 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
> u->premain[3] = cygwin_premain3;
> u->fmode_ptr = &_fmode;
>
> - /* This is used to record what the initial sp was. The value is needed
> - when copying the parent's stack to the child during a fork. */
> - u->initial_sp = (char *) __builtin_frame_address (1);
> + /* Unused */
> + u->initial_sp = nullptr;
We're not building in C++11 mode yet. I fixed that locally to use
NULL instead, which I'd prefer anyway. Patch applied.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160320/4120df59/attachment.sig>
More information about the Cygwin-patches
mailing list