<?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>cpp &#8211; Accidents Happen</title>
	<atom:link href="https://ah.thameera.com/tag/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>https://ah.thameera.com</link>
	<description>In the dark</description>
	<lastBuildDate>Sat, 23 Dec 2017 15:10:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">56521109</site>	<item>
		<title>C++17 finalized</title>
		<link>https://ah.thameera.com/c17-finalized/</link>
					<comments>https://ah.thameera.com/c17-finalized/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Sat, 23 Dec 2017 15:10:40 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c++17]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[swift]]></category>
		<guid isPermaLink="false">https://ah.thameera.com/?p=697</guid>

					<description><![CDATA[The C++17 specification has been finalized. The actual specification is under a paywall (wtf), but you can get the final draft of the pdf here. But it&#8217;s 1448 pages long and you most likely don&#8217;t have time to go over everything. However, there&#8217;s this nice writeup that summarizes the new features in C++17. There are [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The C++17 specification has been finalized. The <a href="https://www.iso.org/standard/68564.html">actual specification</a> is under a paywall (wtf), but you can get the final draft of the pdf <a href="https://wg21.link/standard">here</a>. But it&#8217;s 1448 pages long and you most likely don&#8217;t have time to go over everything.</p>
<p>However, there&#8217;s <a href="https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP17.md">this nice writeup</a> that summarizes the new features in C++17. There are no new groundbreaking features, but some handy additions you might wanna use.</p>
<p>One of the first things that caught my eye is <a href="https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP17.md#stdoptional"><code>std::optional</code></a>. I love <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-ID330">optionals in Swift</a>. They let you wrap values which might or might not be null and reduces the chances of null pointer exceptions. <code>std::optional</code> is a bit more awkward to use than Swift&#8217;s built-in optionals, but I hope people would start using them.</p>
<p>There&#8217;s also <a href="https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP17.md#nested-namespaces">nested namespaces</a> and <a href="https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP17.md#structured-bindings">structured bindings</a> which will help with brevity and readability. Structured bindings are similar to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">destructuring in JavaScript</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/c17-finalized/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">697</post-id>	</item>
		<item>
		<title>How can you tell the type of a void pointer?</title>
		<link>https://ah.thameera.com/how-can-you-tell-the-type-of-a-void-pointer/</link>
					<comments>https://ah.thameera.com/how-can-you-tell-the-type-of-a-void-pointer/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Tue, 21 Nov 2017 16:20:54 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">http://ah.thameera.com/?p=639</guid>

					<description><![CDATA[TLDR: You can&#8217;t There&#8217;s a writeup on a newly found vulnerability in Adobe Acrobat Readers: We all know that void pointers are by definition typeless, may point to any object, and any object may be cast to it. But surely, after we’ve cast an object pointer to a void pointer, it’s still possible somehow to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>TLDR: You can&#8217;t</p>
<p>There&#8217;s <a href="https://cybellum.com/cy-2017-011-type-confusion-in-adobe-acrobat/">a writeup</a> on a newly found vulnerability in Adobe Acrobat Readers:</p>
<blockquote><p>We all know that void pointers are by definition typeless, may point to any object, and any object may be cast to it. But surely, after we’ve cast an object pointer to a void pointer, it’s still possible somehow to detect its origin type, right? Not quite.</p>
<p>Once an object is cast to a void pointer, it’s absolutely impossible to detect its origin type. So, how do we check the type of a void*? The answer is that we don’t. And when you try, what you get is a vulnerability.</p></blockquote>
<p>In case you&#8217;re not familiar with void pointers in C/C++, you can assign _any_ pointer to a void pointer, regardless of the type.</p>
<blockquote><p><code>void *ptr = any_ptr;</code></p></blockquote>
<p> This can be helpful if you don&#8217;t know what kind of a pointer you will receive in a function, etc. But usually it&#8217;s better to avoid them like the plague.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/how-can-you-tell-the-type-of-a-void-pointer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">639</post-id>	</item>
	</channel>
</rss>
