<br><br><div class="gmail_quote">On Thu, Nov 5, 2009 at 10:35 PM, David Cournapeau <span dir="ltr"><<a href="mailto:david@ar.media.kyoto-u.ac.jp">david@ar.media.kyoto-u.ac.jp</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;">
<div class="im">Charles R Harris wrote:<br>
> So you are going to leave us all hanging here in curiosity? What is<br>
> your solution?<br>
<br>
</div>I had to sleep :)<br>
<br>
The solution is based on parsing the generated binary code - that's how<br>
MPFR is doing it, so it has been tested in the wild. The code to compile<br>
is something like:<br>
<br>
/* "before" is 16 bytes to ensure there's no padding between it and "x".<br>
 *    We're not expecting any "long double" bigger than 16 bytes or with<br>
 *       alignment requirements stricter than 16 bytes.  */<br>
typedef long double test_type;<br>
<br>
struct {<br>
        char         before[16];<br>
        test_type    x;<br>
        char         after[8];<br>
} foo = {<br>
        { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',<br>
          '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },<br>
        -123456789.0,<br>
        { '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' }<br>
};<br>
<br>
They compile it, parse with awk from the dump od -f.<br></blockquote><div><br>So the before/after bits are tags that mark the beginning/end of the type for the parse? Any particular reason not to use a string? "David Cournapeau" should work :-)<br>
<br>Chuck<br><br></div></div>