<font size=2 face="sans-serif">I know of at least 4 compilers that do
not do look ahead (beyond a token or two), and are single pass.</font>
<br>
<br><font size=2 face="sans-serif">Regards,<br>
<br>
Rajan Bhakta<br>
z/OS XL C/C++ Compiler Technical Architect<br>
ISO C Standards Representative for Canada<br>
C Compiler Development<br>
Contact: rbhakta@us.ibm.com, Rajan Bhakta/Houston/IBM</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">David Hough CFP <pcfp@oakapple.net></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">cfp-interest@ucbtest.org,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">05/30/2014 04:35 PM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">[Cfp-interest]
order of declaration in C</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by:
</font><font size=1 face="sans-serif">cfp-interest-bounces@oakapple.net</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2><br>
One of the possible problems of try/catch is that<br>
the list of floating-point exceptions to be caught comes after the <br>
code that must be compiled knowing about them. So that implies some
sort<br>
of lookahead to see what catches follow a try block before compiling it.<br>
Note that if catches are to be implemented with traps, the trap enables<br>
could be embodied in preamble and postambles <br>
that are compiled after the try and<br>
catches are compiled, but executed before and after the try. However<br>
if the catches are to be implemented by checking flags within the try block,
<br>
those flag checks should be inserted in the code for the try block.<br>
If the flag checkes are implemented at the end of the try block, then<br>
it becomes a preamble/postamble situation again. However we
really<br>
want to encourage compilers to detect exceptions as soon as possible<br>
because continuing execution with a bunch of NaNs or subnormals might<br>
get very expensive - only to be thrown away anyway.<br>
<br>
My question is: is there anything else in C that requires such lookahead<br>
in order to generate code?<br>
Is this a big enough deal to worry about?<br>
<br>
Ian proposes declaring the exceptions of interest in advance, but I figure<br>
if you're going to do that, you might as well declare the exception<br>
handling in advance too, so it's all in one place. Maybe
something like<br>
<br>
Instead of conventional,<br>
<br>
try {<br>
normal code<br>
}<br>
catch_fe(e, elist) {<br>
exceptional code<br>
}<br>
<br>
suppose the syntax for catch_fe is more like:<br>
<br>
try {<br>
catch_fe(e, elist) {<br>
exceptional code<br>
}<br>
normal code<br>
}<br>
<br>
I'm sure that will bother anybody used to conventional try/catch.<br>
<br>
<br>
_______________________________________________<br>
Cfp-interest mailing list<br>
Cfp-interest@oakapple.net<br>
</font></tt><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest"><tt><font size=2>http://mailman.oakapple.net/mailman/listinfo/cfp-interest</font></tt></a><tt><font size=2><br>
<br>
</font></tt>
<br>