<br><br><div class="gmail_quote">On Fri, Sep 21, 2012 at 11:27 AM, Adam Lee <span dir="ltr"><<a href="mailto:adam8157@gmail.com" target="_blank">adam8157@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, Sep 21, 2012 at 10:15:01AM +0530, Lokesh Walase wrote:<br>
> 0.I read that ANSI C rules for variable declaration says that one must declare<br>
> the variables at the beginning of any scope block.<br>
> C99 onwards we are allowed to declare variables as & how required.<br>
><br>
> 1.NOW, my doubt is what happens in the actual "practical/real-world" codes that<br>
> are written in industry.<br>
> Do everyone *strictly* follow the ANSI C rules & declare the variables at the<br>
> beginning of the scope ?<br>
<br>
</div>Yes, I do.<br>
<div class="im"><br>
> 2.Also , why are we still following that old rule ? Is it so that old codes of<br>
> 70s can be used with new codes ?<br>
<br>
</div>Because I like it. And I think it's better sometimes, for example,<br>
variable declaration you mentioned, it's eaiser to trace all variables<br>
by following the ANSI C standard.<br>
<br>
ANSI C codes can be used with any modern compiler. And you can mix it<br>
with other newer standards.<br>
<div class="im"><br>
> 3.There must be some standard that all of us need to follow , so what are they<br>
> ?<br>
<br>
</div>May be the standards followed by most people are gnu89(ANSI C with GCC<br>
extensions) and C99.<br></blockquote><div><br></div><div>Thanks for the reply Adam !</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
PS, this is kind of out of topic in a kernel mail-list.<br></blockquote><div><br></div><div>Yeah , even I was sort of confused whether to aks this here or not.</div><div>Will take next time onwards :) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Regards,<br>
Adam Lee<br>
<a href="http://adam8157.info" target="_blank">http://adam8157.info</a><br>
</font></span></blockquote></div><br>