<div class="gmail_quote">On Thu, Feb 3, 2011 at 11:46 PM, Henry Cejtin <span dir="ltr"><<a href="mailto:henry.cejtin@sbcglobal.net">henry.cejtin@sbcglobal.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The following program segfaults when run:<br>
<br>
val printf = _import "printf": string * int -> unit;<br>
val () = printf ("You are a dog %d0000", 99)<br>
val () = printf ("Hello silly %d0000", 123)<br></blockquote><div><br>My first answer was: null terminate your string.<br></div></div><br>However, the segfault persists. If you replace "printf" with "test":<br>
void test(const char* s, int x) {<br> printf(s, x);<br>}<br>... it works.<br><br>The problem also only appears for me when I target amd64. i386 works.<br><br>