<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi everyone,</p>
<p>what is the proper way to determine the surrounding block/scope
of a statement?</p>
<p>I want to insert in each branch some diagnostic code like e.g.<br>
</p>
<p><font face="Courier New, Courier, monospace">int foo(void) {</font></p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"> if ( ...)
return 0;</font></p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"> else {</font></p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"> return 1;<br>
</font> </p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"> </font> }</p>
<p>}<br>
</p>
<p>transform into:</p>
<p><font face="Courier New, Courier, monospace">int foo(void) {</font></p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"> if ( ...) {</font></p>
<p><font face="Courier New, Courier, monospace"> somediagnostic();<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> return 0;</font></p>
<p><font face="Courier New, Courier, monospace"> } else {</font></p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"><font face="Courier
New, Courier, monospace"> somediagnostic();</font></font></p>
<p><font face="Courier New, Courier, monospace"><font face="Courier
New, Courier, monospace"></font> return 1;<br>
</font> </p>
<font face="Courier New, Courier, monospace"> </font>
<p><font face="Courier New, Courier, monospace"> </font> }</p>
<p>}<br>
</p>
<br>
<br>
Thanks<br>
<br>
Marcel<br>
</body>
</html>