From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA20969; Tue, 2 Mar 2004 16:08:31 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA20942 for ; Tue, 2 Mar 2004 16:08:29 +0100 (MET) From: nickgrey@softhome.net Received: from jive.SoftHome.net (jive.SoftHome.net [66.54.152.27]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i22F8bIq032095 for ; Tue, 2 Mar 2004 16:08:38 +0100 Received: (qmail 15941 invoked by uid 417); 2 Mar 2004 15:08:27 -0000 Received: from mambo-.softhome.net (HELO softhome.net) (172.16.2.15) by shunt-smtp-out-0 with SMTP; 2 Mar 2004 15:08:27 -0000 Received: from localhost (localhost [127.0.0.1]) (uid 417) by softhome.net with local; Tue, 02 Mar 2004 08:08:27 -0700 To: caml-list@inria.fr Subject: [Caml-list] Different behaviour in native and bytecode compilations (Compiler Bug?) Date: Tue, 02 Mar 2004 08:08:27 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Sender: nickgrey@softhome.net X-Originating-IP: [81.178.226.3] Message-ID: X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; compilations:01 bug:01 camlers:01 ncurses:01 natively:01 runtime:01 ncurses:01 kib:99 bug:01 ocamlopt:01 behave:01 3.07:01 linked:01 compiler:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 20 Hi Camlers. I have a program which uses the ncurses library. It runs as expected when compiled natively, and when bytecode compiled in custom runtime mode. But when compiled with ncurses bindings as a shared library, it produces different, seemingly incorrect output. I've created a minimal example of this behaviour. The code is too still too big to attach, as it obviously includes bindings for ncurses. but I've archived it here (60KiB): http://draco.dyndns.org/~nick/bug.tar.gz Running make will build 3 executables. bug_native and bug_bytecode1 produce the output I expect (2 vertical rows of Xs), something like this: X X X X X X but with bug_bytecode2, which is exactly the same code, but linked differently, the second row of Xs are horizontal, rather than vertical: X X X XXX Any suggestions as to why this might happen? I'm not an expert in O'Caml and especially not in using C bindings, so I could be doing something wrong, but the fact that it only happens with certain linking options makes me suspect it is a compiler bug. Or could it be something wrong with the C bindings for ncurses? (I didn't write them myself.) I've checked in the ocamlopt documentation, and I'm not using any of the constructs which behave differently under native compilation, but I don't think that's relevant anyway. I'm using O'Caml 3.07+2 and ncurses 5.4. Thanks in advance, Nick PS. Thanks to all those who replied to my previous query on polymorphic variants. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners