<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:osnews="http://osnews.com/rss2#">
	<channel>
		<title>OSNews: </title>
		<link>http://www.osnews.com/story/20566/GCC_Hacks_in_the_Linux_Kernel</link>
		<description>Exploring the Future of Computing</description>
		<language>en-us</language>
		<copyright>Copyright 2001-2009, David Adams</copyright>
		<webMaster>adam+nospam@osnews.com</webMaster>
		<lastBuildDate>Mon, 09 Nov 2009 04:49:12 GMT</lastBuildDate>
		<image>
			<url>http://www.osnews.com/images/osnews.gif</url>
			<title>OSNews.com</title>
			<link>http://www.osnews.com</link>
		</image>
		<item>
			<title>Comment by Yamin</title>
			<link>http://osnews.com/thread?337967</link>
			<guid isPermaLink="true">http://osnews.com/thread?337967</guid>
			<description>----------<br />
#define min(x, y) ({				\<br />
	typeof(x) _min1 = (x);			\<br />
	typeof(y) _min2 = (y);			\<br />
	(void) (&amp;_min1 == &amp;_min2);		\<br />
	_min1 &lt; _min2 ? _min1 : _min2; })<br />
-------------<br />
<br />
anyone know what why this line is there:<br />
void) (&amp;_min1 == &amp;_min2);<br />
?</description>
			<pubDate>Fri, 21 Nov 2008 04:58:00 GMT</pubDate>
			<author>donotreply@osnews.com (Yamin)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Comment by Yamin</title>
			<link>http://osnews.com/thread?337969</link>
			<guid isPermaLink="true">http://osnews.com/thread?337969</guid>
			<description>It has to do with typechecking.<br />
<br />
Making a simple program:<br />
int x = 10;<br />
long y = 20;<br />
long r = min(x, y);<br />
<br />
Gives the following warning:<br />
warning: comparison of distinct pointer types lacks a cast</description>
			<pubDate>Fri, 21 Nov 2008 05:34:00 GMT</pubDate>
			<author>donotreply@osnews.com (irasnyd)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Comment by Yamin</title>
			<link>http://osnews.com/thread?337982</link>
			<guid isPermaLink="true">http://osnews.com/thread?337982</guid>
			<description>Could you please explain further. For me the line (void) (&amp;_min1 == &amp;_min2); is still somewhat inexplicable, since it does not seem to do anything other than compare the two pointers of the temporary variables (which are always distinct) and cast the result to void. So it seems to me as an addendum to the macro (they must have first written it without this line) to keep GCC from generating warnings. Why GCC refrains from the warning after this line is not completely clear to me.</description>
			<pubDate>Fri, 21 Nov 2008 13:34:00 GMT</pubDate>
			<author>donotreply@osnews.com (drahca)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[3]: Comment by Yamin</title>
			<link>http://osnews.com/thread?337983</link>
			<guid isPermaLink="true">http://osnews.com/thread?337983</guid>
			<description>Maybe it's in there <i>in order to</i> generate a warning.</description>
			<pubDate>Fri, 21 Nov 2008 13:45:00 GMT</pubDate>
			<author>donotreply@osnews.com (theosib)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[4]: Comment by Yamin</title>
			<link>http://osnews.com/thread?337985</link>
			<guid isPermaLink="true">http://osnews.com/thread?337985</guid>
			<description>Ah. That would make more sense. <img src="/images/emo/smile.gif" alt=";)" />  Thank you.</description>
			<pubDate>Fri, 21 Nov 2008 13:54:00 GMT</pubDate>
			<author>donotreply@osnews.com (drahca)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Too much hacks</title>
			<link>http://osnews.com/thread?337986</link>
			<guid isPermaLink="true">http://osnews.com/thread?337986</guid>
			<description>.</description>
			<pubDate>Fri, 21 Nov 2008 14:05:00 GMT</pubDate>
			<author>donotreply@osnews.com (sbenitezb)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Clever coding for efficiency is nice...</title>
			<link>http://osnews.com/thread?338045</link>
			<guid isPermaLink="true">http://osnews.com/thread?338045</guid>
			<description>And having special optimizations in the compiler is nice.  But, isn't it a goal to have the OS as portable as possible to make it easier to port?  Granted, GCC is readily available for most any platform, and readily enough ported to any other platform as needed, but so much for the claim of Linux using open standards, while at the same time purposely using compiler hacks that no other compiler has, making the code less portable.</description>
			<pubDate>Sat, 22 Nov 2008 02:09:00 GMT</pubDate>
			<author>donotreply@osnews.com (JonathanBThompson)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Clever coding for efficiency is nice...</title>
			<link>http://osnews.com/thread?338082</link>
			<guid isPermaLink="true">http://osnews.com/thread?338082</guid>
			<description>Has Linux EVER been compiled with a non-GNU compiler?</description>
			<pubDate>Sat, 22 Nov 2008 19:32:00 GMT</pubDate>
			<author>donotreply@osnews.com (braddock)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Clever coding for efficiency is nice...</title>
			<link>http://osnews.com/thread?338083</link>
			<guid isPermaLink="true">http://osnews.com/thread?338083</guid>
			<description>It is good to have such useful extensions, because it makes the code faster, and decreases chances of errors in the code. Pure C standard isn't enough for the kernel<br />
(and a small part of it is still platform-dependent ASM, anyway).<br />
<br />
Portability of the Linux kernel is not in danger because gcc supports enough platforms.</description>
			<pubDate>Sat, 22 Nov 2008 19:33:00 GMT</pubDate>
			<author>donotreply@osnews.com (siki_miki)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Clever coding for efficiency is nice...</title>
			<link>http://osnews.com/thread?338086</link>
			<guid isPermaLink="true">http://osnews.com/thread?338086</guid>
			<description>To answer my own question...<br />
<br />
In 2004 a German group apparently got the Linux 2.6 Kernel to compile using the Intel Compiler.  It required patches and a custom pre-processor to convert some of the GCC directives.  Interesting...<br />
<br />
<a href="http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html" rel="nofollow">http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html</a> <br />
<br />
They claimed performance improvements of up to 40% for some limited areas of the kernel, and 8-9% overall performance improvement in general.</description>
			<pubDate>Sat, 22 Nov 2008 19:50:00 GMT</pubDate>
			<author>donotreply@osnews.com (braddock)</author>
			<category>Comments</category>
		</item>
	</channel>
</rss>
