[ale] gcc programming

James Baldwin jbaldwin at antinode.net
Sun Jan 23 22:26:34 EST 2005


On 23 Jan 2005, at 14:36, Danny Cox wrote:

> 	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




More information about the Ale mailing list