* [Caml-list] Different behaviour in native and bytecode compilations (Compiler Bug?)
@ 2004-03-02 15:08 nickgrey
[not found] ` <16452.49607.575894.790498@barrow.artisan.com>
0 siblings, 1 reply; 2+ messages in thread
From: nickgrey @ 2004-03-02 15:08 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Caml-list] Re: Different behaviour in native and bytecode compilations (Compiler Bug?)
[not found] ` <16452.49607.575894.790498@barrow.artisan.com>
@ 2004-03-03 0:22 ` nickgrey
0 siblings, 0 replies; 2+ messages in thread
From: nickgrey @ 2004-03-03 0:22 UTC (permalink / raw)
To: John Gerard Malecki; +Cc: caml-list
John Gerard Malecki writes:
> I built your program "out of the box" and I get the exact behavior for
> all executables.
>
> X
> X
> X
>
> X
> X
> X
>
> :; ocamlc.opt -version
> 3.07
> :; ocamlopt.opt -version
> 3.07
>
Thanks John... your message prompted me to try another version. I couldn't
find a plain 3.07 (as it's been replaced by 3.07+2 on the website), but I
downloaded and installed 3.06. My demo program compiled with 3.06 this also
displays the correct output. (Correct as in the bug doesn't happen.) So it
seems that 3.06 and 3.07 work correctly, but 3.07+2 doesn't, for me at
least.
Perhaps someone on the list with 3.07+2 installed can compile my demo
program and let me know what happens. This will tell me if this is a bug
introduced in 3.07+2 (or 3.07+1) or if it's a bug that just affects me.
(Maybe I broke my O'Caml install somehow, although I don't really see how.)
Regards,
Nick
-------------------
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-03 0:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-02 15:08 [Caml-list] Different behaviour in native and bytecode compilations (Compiler Bug?) nickgrey
[not found] ` <16452.49607.575894.790498@barrow.artisan.com>
2004-03-03 0:22 ` [Caml-list] " nickgrey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox