[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



> 	I use this a lot, but there a new gcc-only construct "__FUNCTION__",
> used like "__FILE__", which will substitute the name of the current
> function as a quoted string.

__FUNCTION__ is aliased to __func__ and has been for some time. Please 
DO NOT use __FUNCTION__. The only reason to use this is on _old_ 
versions of GCC. __func__ is standardized and has been since the early 
drafts of C99.

> Just FYI, and as a matter of both style and later convenience, I write
> my functions with the scope and type on a separate line like this:
<snip>

Ew. That's a broken appearing implementation of old-style c 
declarations. This would be somewhat useful when digging through 
/usr/include, however, since no sane programmers (/me dons flame 
retardent undies) write their declarations this way it isn't possible 
without reformatting all of your system headers.

If you do this in your own code I'd just recommend getting a decent IDE 
to program in: Xcode, SlickEdit, even emacs are more than capable of 
returning you function declarations based on simple searches across the 
whole project without necessitating the adoption of uncommon 
programming styles to ease grepping.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part



</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00872" href="msg00872.html">[ale] gcc programming</a></strong>
<ul><li><em>From:</em> ringo at margaritasrus.com (ringo)</li></ul></li>
<li><strong><a name="00881" href="msg00881.html">[ale] gcc programming</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="00907" href="msg00907.html">[ale] gcc programming</a></strong>
<ul><li><em>From:</em> danscox at mindspring.com (Danny Cox)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00926.html">[ale] Load...</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00928.html">[ale] debian acpi module errors, framebuffer</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00907.html">[ale] gcc programming</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00874.html">[ale] comcast static IP?</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00927"><strong>Date</strong></a></li>
<li><a href="threads.html#00927"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>