<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Playing With Pointers &#187; C++</title>
	<atom:link href="http://playingwithpointers.com/archives/tag/c/feed" rel="self" type="application/rss+xml" />
	<link>http://playingwithpointers.com</link>
	<description>One step closer to reflective equilibrium.</description>
	<lastBuildDate>Thu, 02 Feb 2012 11:36:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Theoretically Correct C++ Compiler</title>
		<link>http://playingwithpointers.com/archives/532</link>
		<comments>http://playingwithpointers.com/archives/532#comments</comments>
		<pubDate>Tue, 24 May 2011 17:04:07 +0000</pubDate>
		<dc:creator>Sanjoy</dc:creator>
				<category><![CDATA[Digital Dope]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[turing complete]]></category>

		<guid isPermaLink="false">http://playingwithpointers.com/?p=532</guid>
		<description><![CDATA[I just realized that a C++ compiler can never be theoretically correct. This follows from the fact that C++ templates are Turing Complete (no, really) and the halting problem. We can never say for sure whether a template expression is indeed infinitely recursive or is just taking too long to &#8220;parse&#8221;. Sweet, but disappointing.]]></description>
			<content:encoded><![CDATA[<p align="justify">I just realized that a C++ compiler can never be theoretically correct. This follows from the fact that C++ templates are Turing Complete (no, really) and the halting problem. We can never say for sure whether a template expression is indeed infinitely   recursive or is just taking too long to &#8220;parse&#8221;.</p>
<p align="justify">Sweet, but disappointing.</p>
]]></content:encoded>
			<wfw:commentRss>http://playingwithpointers.com/archives/532/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>For those who need to Lint large projects.</title>
		<link>http://playingwithpointers.com/archives/394</link>
		<comments>http://playingwithpointers.com/archives/394#comments</comments>
		<pubDate>Wed, 24 Nov 2010 05:58:56 +0000</pubDate>
		<dc:creator>Sanjoy</dc:creator>
				<category><![CDATA[Digital Dope]]></category>
		<category><![CDATA[autoconf]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[lint]]></category>

		<guid isPermaLink="false">http://playingwithpointers.com/?p=394</guid>
		<description><![CDATA[For certain reasons, I had to lint a rather large autoconf based project. While running splint *.c is trivial for a small project, things can get rather convoluted with autoconf&#8216;s intervention, notably when it comes to mentioning include directories on the command line. The (rather obvious) solution I used was to have make invoke a [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">
For certain reasons, I had to lint a rather large <code>autoconf</code> based project. While running <code>splint *.c</code> is trivial for a small project, things can get rather convoluted with <code>autoconf</code>&#8216;s intervention, notably when it comes to mentioning include directories on the command line.
</p>
<p align="justify">
The (rather obvious) solution I used was to have make invoke a shell-script instead of the C compiler directly and have the script run splint and redirect its output to some temporary file I could later open. Here is the script, just in case anyone else finds it useful:
</p>
<pre>
#!/bin/zsh

splint_args=""
for arg in "$@"; do
	if [[ $arg =~ '(.*\.c)|(-I.*)' ]]; then
		splint_args="$arg $splint_args"
	fi
done
if [[ -n $splint_args ]]; then
	$splint_args="$splint_args"
	splint $=splint_args &#038;>> /tmp/splint-output
fi
cc $@
</pre>
<p align="justify">
Using the script is easy, instead of <code>./configure --foo=bar --disable-baz</code>, do a <code>CC=/path/to/script LD=ld ./configure --foo=bar --disable-baz</code>. Also, don&#8217;t forget to <code>chmod +x</code> the script. Happy Hacking! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://playingwithpointers.com/archives/394/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.669 seconds -->

