From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7GGlMVJ026902 for ; Tue, 16 Aug 2011 18:47:22 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAOidSk5QRFuw/2dsb2JhbABBqD93gUABAQUMJgFGEAsYHBIUKCGIBbljhWlfBKQI X-IronPort-AV: E=Sophos;i="4.68,234,1312149600"; d="scan'208";a="116008672" Received: from furbychan.cocan.org ([80.68.91.176]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 16 Aug 2011 18:47:17 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1QtMnM-00008e-M6; Tue, 16 Aug 2011 17:47:16 +0100 Date: Tue, 16 Aug 2011 17:47:16 +0100 From: "Richard W.M. Jones" To: =?iso-8859-1?B?VPZy9ms=?= Edwin Cc: caml-list@inria.fr Message-ID: <20110816164716.GA466@annexia.org> References: <20110816152550.GA21081@annexia.org> <20110816155137.GA18365@ccellier.rd.securactive.lan> <20110816161042.GA31932@annexia.org> <20110816162205.GC31932@annexia.org> <20110816162719.GD31932@annexia.org> <4E4A9C17.7060605@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4E4A9C17.7060605@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Interfacing with C: bad practice On Tue, Aug 16, 2011 at 07:34:31PM +0300, Török Edwin wrote: > Undefined behaviour doesn't mean it must show different results with -O2, > it *might* if the compiler decides to do some optimization. > > But isn't this 'f(g(), x)' issue the same as the classic example of undefined behaviour with f(++i, ++i)? I was a bit unclear. I just meant the program no longer displayed random numbers. I agree (now) that this appears to be unspecified behaviour, like f(++i, ++i), but rather more indirectly. Rich. -- Richard Jones Red Hat