From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/155 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: cluts review Date: Wed, 13 Jul 2011 15:52:59 -0400 Message-ID: <20110713195259.GG16618@brightrain.aerifal.cx> References: <20110713110723.GA22153@openwall.com> <4E1D8964.3020502@gmail.com> <20110713160327.GA24660@openwall.com> <4E1DCDE5.1040008@gmail.com> <20110713170551.GA25095@openwall.com> <4E1DD4F3.5090206@gmail.com> <20110713175201.GA25532@openwall.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1310588978 26999 80.91.229.12 (13 Jul 2011 20:29:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 20:29:38 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-237-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 13 22:29:34 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Qh63k-0003S4-1u for gllmg-musl@lo.gmane.org; Wed, 13 Jul 2011 22:29:28 +0200 Original-Received: (qmail 18259 invoked by uid 550); 13 Jul 2011 20:02:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18251 invoked from network); 13 Jul 2011 20:02:45 -0000 Content-Disposition: inline In-Reply-To: <20110713175201.GA25532@openwall.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:155 Archived-At: On Wed, Jul 13, 2011 at 09:52:01PM +0400, Solar Designer wrote: > I think you're confusing things. Maybe Rich suggested that you use > sigaction() instead of signal()? That's fine, but it has nothing to do > with the choice of setjmp() vs. sigsetjmp(). You should always use sigaction instead of signal because the latter leaves too much implementation-defined to be useful. With that said, let's just drop this bikeshed. sigsetjmp/siglongjmp are just as easy to use and it's more certain that they'll work in the presence of buggy implementations, so let's go with them. > > This reminds me, the code is distinctly C99, and it tests SUSv4 > > functions, so if you don't mind, for cluts, I'll use those two standards > > I am fine with limiting cluts to newer systems if Rich is fine with that. I think it's reasonable for now, but at some point it might be worth evaluating the level of dependency and reducing it if anyone wants to test older libraries. I don't think there's any use in avoiding C99 features that are purely at the compiler level (like compound literals) because any current or future compiler capable of being used on unix-like systems will support these. > > Oh, and I do believe I know aht "clobbered" means (overwriting the new > > value of the variable with the old one, from when the context was saved, > > right?). > > Yes. Do you know in what cases this happens, and how to prevent it? Actually saying it's "clobbered" is an understatement. Breaking the rules invokes undefined behavior, and in at least one real-world case, gcc generated code that performed a memory read from something like 0x60 (absolute address) instead of 0x60(%esp). Don't ask me why; that's UB. Proper code should not invoke UB. Rich