<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: 10 Halloween Horror Code Stories That Will Freak You Out	</title>
	<atom:link href="https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Fri, 03 Nov 2017 14:22:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: Franck Horlaville		</title>
		<link>https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/#comment-629</link>

		<dc:creator><![CDATA[Franck Horlaville]]></dc:creator>
		<pubDate>Fri, 03 Nov 2017 14:22:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2469#comment-629</guid>

					<description><![CDATA[Hi! The one piece of code which started off my &quot;ugly&quot; library was a page-long PHP code filtering and sorting ... the result of a &quot;select * from xyz&quot; MySQL query. I had just joined that company as TD and the &quot;developer&quot; in question was quite vocally challenging the fact he still hadn&#039;t been promoted to a senior role.]]></description>
			<content:encoded><![CDATA[<p>Hi! The one piece of code which started off my &#8220;ugly&#8221; library was a page-long PHP code filtering and sorting &#8230; the result of a &#8220;select * from xyz&#8221; MySQL query. I had just joined that company as TD and the &#8220;developer&#8221; in question was quite vocally challenging the fact he still hadn&#8217;t been promoted to a senior role.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/#comment-627</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Thu, 02 Nov 2017 20:38:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2469#comment-627</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/#comment-626&quot;&gt;Tomek Jonarski&lt;/a&gt;.

Love it, I&#039;ve added it to the post :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/#comment-626">Tomek Jonarski</a>.</p>
<p>Love it, I&#8217;ve added it to the post 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tomek Jonarski		</title>
		<link>https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/#comment-626</link>

		<dc:creator><![CDATA[Tomek Jonarski]]></dc:creator>
		<pubDate>Thu, 02 Nov 2017 13:52:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2469#comment-626</guid>

					<description><![CDATA[I remember one evil piece of code from one project. Not sure if that was a bad trolling attempt or a mistake of very tired programmer but it took some time to find :)

return &quot;false&quot;;]]></description>
			<content:encoded><![CDATA[<p>I remember one evil piece of code from one project. Not sure if that was a bad trolling attempt or a mistake of very tired programmer but it took some time to find 🙂</p>
<p>return &#8220;false&#8221;;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kev Kitchens		</title>
		<link>https://www.fluentcpp.com/2017/10/31/halloween-horror-code-stories/#comment-625</link>

		<dc:creator><![CDATA[Kev Kitchens]]></dc:creator>
		<pubDate>Tue, 31 Oct 2017 17:44:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2469#comment-625</guid>

					<description><![CDATA[I tweeted what became item #1 on this list, so I wanted to clarify a little about what this code was actually doing (this is 100% *not* Jonathan&#039;s fault for misunderstanding as 160 characters wasn&#039;t enough for me to provide context).

The threads could all read/modify this flag directly, so declaring it &#039;volatile&#039; wouldn&#039;t provide necessary atomicity guarantees (this revelation was described by one co-worker as feeling like having their religious beliefs challenged). Fortunately, we compile in C++11 code, so std::atomic was available.

The Fs::Value class is meant to allow internal values in our app to be exposed for read (and sometimes write) access via a virtual filesystem, sort of like Linux sysfs for a userspace app. The major sin was that the API didn&#039;t have an overload for Register() that accepted a bool*, so somebody quite a while back decided uint16_t* was close enough and shoved it in through that interface (even though that sort of cast is UB). Since the pointer passed in was kept and used for servicing read/write operations from the virtual filesystem, this could have broken in all sorts of ways (e.g. memory corruption since uint16_t and bool are different sizes on our platform or even resulting in a bool that evaluated as both true and false or neither true nor false: https://stackoverflow.com/questions/4518951/engineered-bool-compares-equal-to-both-true-and-false-why).]]></description>
			<content:encoded><![CDATA[<p>I tweeted what became item #1 on this list, so I wanted to clarify a little about what this code was actually doing (this is 100% *not* Jonathan&#8217;s fault for misunderstanding as 160 characters wasn&#8217;t enough for me to provide context).</p>
<p>The threads could all read/modify this flag directly, so declaring it &#8216;volatile&#8217; wouldn&#8217;t provide necessary atomicity guarantees (this revelation was described by one co-worker as feeling like having their religious beliefs challenged). Fortunately, we compile in C++11 code, so std::atomic was available.</p>
<p>The Fs::Value class is meant to allow internal values in our app to be exposed for read (and sometimes write) access via a virtual filesystem, sort of like Linux sysfs for a userspace app. The major sin was that the API didn&#8217;t have an overload for Register() that accepted a bool*, so somebody quite a while back decided uint16_t* was close enough and shoved it in through that interface (even though that sort of cast is UB). Since the pointer passed in was kept and used for servicing read/write operations from the virtual filesystem, this could have broken in all sorts of ways (e.g. memory corruption since uint16_t and bool are different sizes on our platform or even resulting in a bool that evaluated as both true and false or neither true nor false: <a href="https://stackoverflow.com/questions/4518951/engineered-bool-compares-equal-to-both-true-and-false-why" rel="nofollow ugc">https://stackoverflow.com/questions/4518951/engineered-bool-compares-equal-to-both-true-and-false-why</a>).</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
