From 8f7615ad790cb837e1888dc4064c6540ecb1f72d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 24 May 2021 12:32:25 +0200 Subject: [PATCH] c-stack: Document another restriction. Triggered by a discussion with Paul Eggert. * lib/c-stack.h: Mention that ACTION should not use nested functions. --- ChangeLog | 6 ++++++ lib/c-stack.h | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5afb8811b9..43056adcb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-05-24 Bruno Haible + + c-stack: Document another restriction. + Triggered by a discussion with Paul Eggert. + * lib/c-stack.h: Mention that ACTION should not use nested functions. + 2021-05-22 Bruno Haible stdio: Fix compilation error on DragonFly BSD. diff --git a/lib/c-stack.h b/lib/c-stack.h index 56d74f1662..a9a8b13f39 100644 --- a/lib/c-stack.h +++ b/lib/c-stack.h @@ -33,10 +33,15 @@ A null ACTION acts like an action that does nothing. - ACTION must be async-signal-safe. ACTION together with its callees - must not require more than 64 KiB of stack space. Also, - ACTION should not call longjmp, because this implementation does - not guarantee that it is safe to return to the original stack. + Restrictions: + - ACTION must be async-signal-safe. + - ACTION together with its callees must not require more than 64 KiB of + stack space. + - ACTION must not create and then invoke nested functions + , because + this implementation does not guarantee an executable stack. + - ACTION should not call longjmp, because this implementation does not + guarantee that it is safe to return to the original stack. This function may install a handler for the SIGSEGV signal or for the SIGBUS signal or exercise other system dependent exception handling APIs. */ -- 2.39.5