Why the magic number of 100,000,000?  Why not 4 billion, say?<br><br><div class="gmail_quote">On 7 July 2010 04:35, Jay K <span dir="ltr"><<a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
I'm pretty settled on silently losing line numbers over 100 million.<br>
If the host and target are 64 bits it preserves far more.<br>
If someone produces such a file, and it compiles and runs, but gets a runtime error in their code on the wrong line, they can claim they found a compiler bug...<br>
<div class="im"><br>
 - Jay<br>
<br>
----------------------------------------<br>
> From: <a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>
</div>> To: <a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>
> Date: Tue, 6 Jul 2010 20:21:08 +0000<br>
> Subject: [M3devel] fault reports beyond 100mill lines?<br>
<div><div></div><div class="h5">><br>
><br>
> It appears that if a file has over around 100 million lines, that fault reports (nil deref, subrange out of bounds, etc.) get the wrong line number.<br>
> Leave it as ("qualit of implementation"?) or fail an assertion in the compiler earlier (leaving anyone with a huge file kind of stuck (generated?) or, unlikely, expand the range?<br>
> The line number is in an integer along with a 5 bit fault code.<br>
>   We could also allow much larger numbers on 64bit targets.<br>
><br>
><br>
> This is just because there's a "FIXME" comment in parse.c.<br>
> The code is basically right and I'm adding comments and perhaps assertions.<br>
> Certainly we can assert that the fault code is in range.<br>
><br>
><br>
> I think I prefer silently losing bits in the line number, or conveting it to 0 if it is out of bounds or pinning it to maxint.<br>
>   Though it'd be maxint  / 32 which is less "special" looking if someone ever saw it.. though the runtime could<br>
>   report maxint / 32 as maxint.<br>
><br>
>  - Jay<br>
><br>
><br>
                                          </div></div></blockquote></div><br><br clear="all"><br>-- <br>"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."<br>
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.<br>