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

[no subject]



On Sat, 2005-01-22 at 21:52 -0500, Geoffrey wrote:
> This is probably as good a place as any I suspect.

	Agreed!  Not to sound like a troll, but I'd submit that this forum is a
better place for programming questions than other topics attempted here.
"Troll, troll, troll, troll,..." <sung to the tune of "Spam, spam, spam,
spam....".

> You'll likely want to write the debug info to standard error and capture.
> 
> Here's how I do it in C so that I can track where the data was spit out:
> 
> (void)fprintf(stderr, "%s %d: %s\n", __FILE__, __LINE__, debugdata);

	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.

	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:

static char *
foo (char *bar)
{
}

So that a search of:

	grep '^foo' *.c

will return the definition (or is that declaration, I can never remember
which is which ;-) of the function itself, none of it's calls.

-- 
kernel, n.: A part of an operating system that preserves the
medieval traditions of sorcery and black art.

Danny


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00927" href="msg00927.html">[ale] gcc programming</a></strong>
<ul><li><em>From:</em> jbaldwin at antinode.net (James Baldwin)</li></ul></li>
</ul></li></ul>
<!--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>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00906.html">[ale] comcast static IP?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00908.html">[ale] comcast static IP?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00914.html">[ale] gcc programming</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00927.html">[ale] gcc programming</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00907"><strong>Date</strong></a></li>
<li><a href="threads.html#00907"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

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