From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3436 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: valgrind problems Date: Sun, 16 Jun 2013 15:29:29 -0400 Message-ID: <20130616192929.GR29800@brightrain.aerifal.cx> References: <1371375118.16425.368.camel@eris.loria.fr> <1371379388.16425.372.camel@eris.loria.fr> <20130616143140.GL29800@brightrain.aerifal.cx> <1371396379.5692.96.camel@eris.loria.fr> <20130616153117.GO29800@brightrain.aerifal.cx> <1371398332.5692.108.camel@eris.loria.fr> <20130616174008.GF6548@port70.net> <1371405720.5692.129.camel@eris.loria.fr> <20130616192546.GG6548@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1371410988 15493 80.91.229.3 (16 Jun 2013 19:29:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Jun 2013 19:29:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3440-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 16 21:29:50 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UoIdy-0004mr-Qe for gllmg-musl@plane.gmane.org; Sun, 16 Jun 2013 21:29:42 +0200 Original-Received: (qmail 7826 invoked by uid 550); 16 Jun 2013 19:29:42 -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 7818 invoked from network); 16 Jun 2013 19:29:41 -0000 Content-Disposition: inline In-Reply-To: <20130616192546.GG6548@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3436 Archived-At: On Sun, Jun 16, 2013 at 09:25:47PM +0200, Szabolcs Nagy wrote: > * Jens Gustedt [2013-06-16 20:02:00 +0200]: > > as I said up-thread, this is not my own opinion (I personally would > > argue as you do) but expressed in a recent discussion on the list of > > the C standards committee. In addition there is an 10 year old reply > > to a DR that goes in that direction. > > i see > > > And to clarify that, this is not about UB, but about the stability of > > the value. > > i don't see any way "unstable" value can be allowed in c > without invoking UB > > objects have to retain their last stored value or their > initial value > (so object access cannot be unstable) > > the abstract machine is defined in terms of sequencing > side effects and value computations > (so indeterminate values can only have unstable meaning > if all operators have well defined semantics for them: > eg. the semantics of '+' should say that the value of > the result is the sum of the operands or indeterminate > if any of the operands is indeterminate) I agree completely. From an optimizing compiler standpoint, I _wish_ the language admitted such propagation of indeterminate values without invoking full UB, but I don't see any way that the current language of the standard could be interpreted as allowing that. At one point, indeterminate values were deemed to invoke UB (see the vestigial item in J.2) but it seems that the standard has been amended so that indeterminate values are "safe" in most cases as long as the type does not have trap representations. Rich