<?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>Dominique a.k.a. DimStar (Dim*)</title>
	<atom:link href="http://dominique.leuenberger.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://dominique.leuenberger.net/blog</link>
	<description>A passionate openSUSE user</description>
	<lastBuildDate>Sun, 22 Apr 2012 11:26:23 +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>openSUSE 12.2 with X.org Server 1.12.1 ?</title>
		<link>http://dominique.leuenberger.net/blog/2012/04/opensuse-12-2-with-x-org-server-1-12-1/</link>
		<comments>http://dominique.leuenberger.net/blog/2012/04/opensuse-12-2-with-x-org-server-1-12-1/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 20:44:07 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[X.Org]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=216</guid>
		<description><![CDATA[I&#8217;m very excited&#8230; after a few days worth of work and the invaluable help of the openSUSE community, I finally managed to boot up my virtual machine, running openSUSE 12.2M3 and have X.org 1.12.1 running on it. So why am I so happy? It resolves a nasty bug the gnome-team was trying to chase, namely [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very excited&#8230; after a few days worth of work and the invaluable help of the openSUSE community, I finally managed to boot up my virtual machine, running openSUSE 12.2M3 and have X.org 1.12.1 running on it.</p>
<p>So why am I so happy? It resolves a nasty bug the gnome-team was trying to chase, namely the fact that keyboard shortcuts stopped working a while back. Once the issue was identified (the obvious switch from XInput to XInput2 by gnome upstream), there were two solutions: revert XInput2 usage in gnome or get X up-to-date and live happily ever after.</p>
<p>Needless to say, we chose the hard way and started working on the X.org packages.Now, they were solid, but packaging wise everything bug in good shape. A lot of patches applied, many of them not part of the upstream codebase, never sent upstream, or simply not interesting for upstream.</p>
<p>Vincent did a great job in cleaning up the packages, splitting the huge collection in small and manageable pieces (and enabled the awesomeness osc collab offers: upstream version tracking). I took the liberty to work on updating the packages to their latest versions afterward and reworking the main package a bit, especially after having run into issue with xorg being updated, but I forgot the driver packs&#8230; boring details, nothing to worry about.</p>
<p>So, you want to test it?<br />
That&#8217;s a bit trickier.. most of this work already went back to obs://X11:XOrg (the package cleanup and split) but the updates are so far only available in my bracnh (obs://home:dimstar:branches:X11:XOrg). Not all driver packs were updated (namely: nouveau is still missing), as I focused on my virtual machine.</p>
<p>Yet, after having completed these steps, I&#8217;m sure to get the needed boost in motivation again to finish it and to move those packages forward to Factory. Only that we reach Milestone 4 already; wish this would have happened earlier.</p>
<p>So long! Happy testing and machine breaking!</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2012/04/opensuse-12-2-with-x-org-server-1-12-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enhanced typelib based dep generation</title>
		<link>http://dominique.leuenberger.net/blog/2011/12/enhanced-typelib-based-dep-generation/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/12/enhanced-typelib-based-dep-generation/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 08:48:51 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[GNOME]]></category>
		<category><![CDATA[openSUSE]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=214</guid>
		<description><![CDATA[A long time ago I posted about our inclusion of an automatic dependency generator for typelib() style provides and requires. The main goal there was to have the various seed and python based programs depending on gobject-introspection based bindings properly require the bindings, which also dragged in the libraries needed. For the openSUSE 12.2 release [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago I <a href="http://dominique.leuenberger.net/blog/2011/06/gobject-introspection-based-typelib-provides-and-requires/">posted</a> about our inclusion of an automatic dependency generator for typelib() style provides and requires. The main goal there was to have the various seed and python based programs depending on gobject-introspection based bindings properly require the bindings, which also dragged in the libraries needed.</p>
<p>For the openSUSE 12.2 release cycle we have to push this a little further: As the typelib namespace and version does not grow linear together with the shared library name, we have to split the *.typelib files out of the shared library package.</p>
<p>An example why the typelib files need to be split out from the libraries:<br />
Clutter: the library was renamed from libclutter-glx-1.0.so.0 to libclutter-1.0.so.0, the typelib remained Clutter-1.0.typelib. The upgrade process is slightly &#8216;messy&#8217; in this case and a bunch of problems could be avoided by splitting the typelib files out.</p>
<p>But by doing so, this typelib package would really only have some typelib()-style provides, and no dependencies at all, other than the one the packager specifies manually. And there&#8217;s the catch: I&#8217;m by far to lazy to find/add the dependencies manually. Besides that: experience shows that this anyhow would be only done initially when a package is created and then &#8216;forgotten&#8217; until a problem arises. Not what we need and want.</p>
<p>So, I took some time yesterday, wrote a g-ir-dep-tool which loads a specific .typelib and checks for its dependencies. It catches other typelib style ones and also the shared library the tyeplib provides the binding for. Rather nifty and cool.</p>
<p>I already integrated this into my GNOME:Factory branch, doing some  final tests and cleanups. Once entered in GNOME:Factory nothing is going to stop us from splitting the typelib files out.</p>
<p>And all this just to improve the quality of our packages and their dependencies.</p>
<p>(All this work of course is not meant to be just for us, but has been <a href="https://bugzilla.gnome.org/show_bug.cgi?id=665672">submitted for review</a> and inclusion to the gobject-introspection maintainers. So if all goes right, this will show up in some future release)</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/12/enhanced-typelib-based-dep-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VideoLAN Repository / vlc-beta 1.2 changes</title>
		<link>http://dominique.leuenberger.net/blog/2011/10/videolan-repository-vlc-beta-1-2-changes/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/10/videolan-repository-vlc-beta-1-2-changes/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 06:27:09 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[VideoLAN Client]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=210</guid>
		<description><![CDATA[openSUSE Users! The VideoLAN Repository will get through some minor changes. Mainly affected are current users of the vlc-beta packages, BUT there is important news for all of you: The VideoLAN Project moved the VLC Player sources into the future. For this reason, vlc-beta packages as of now will only be built with full capabilities [...]]]></description>
			<content:encoded><![CDATA[<p>openSUSE Users!</p>
<p>The <a href="http://www.videolan.org/vlc/download-suse.html">VideoLAN Repository</a> will get through some minor changes. Mainly affected are current users of the vlc-beta packages, BUT there is important news for all of you:</p>
<p>The <a href="http://www.videolan.org/">VideoLAN Project</a> moved the VLC Player sources into the future. For this reason, vlc-beta packages as of now will only be built with full capabilities for openSUSE 11.4 and Factory (and future releases).<br />
Currently, on 11.3 I had to drop v4l2 features, as the kernel is considered too old to be supported by the latest VLC snapshots (See <a href="http://mailman.videolan.org/pipermail/vlc-devel/2011-October/082321.html">this mail thread</a>)</p>
<p>the existing 1.1.x packages are of course not affected, <strong>but there are plans to have 1.2 tree to become the &#8216;main&#8217; tree for VLC!</strong> This would be some big news and changes coming down our way! Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/10/videolan-repository-vlc-beta-1-2-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Libproxy 0.4.7 released</title>
		<link>http://dominique.leuenberger.net/blog/2011/06/libproxy-0-4-7-released/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/06/libproxy-0-4-7-released/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 23:47:30 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Libproxy]]></category>
		<category><![CDATA[openSUSE]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=196</guid>
		<description><![CDATA[Today we released version 0.4.7 of libproxy. This version add support for Gnome 3 GSettings and bugfixes. Enjoy ! ChangeLog: * Support/require xulrunner 2.0+ * Support linking againgst libwebkit-gtk3 (-DWITH_WEBKIT3=ON) * Port to gsettings for gnome3. (-DWITH_GNOME3=ON[default]) * Issues closed: &#8211; #149: always test for the right python noarch module path &#8211; #155: Cannot compile [...]]]></description>
			<content:encoded><![CDATA[<p>Today we released version 0.4.7 of libproxy. This version add support for Gnome 3 GSettings and bugfixes.</p>
<p>Enjoy !<br />
<span id="more-196"></span><br />
<strong>ChangeLog:</strong></p>
<p>    * Support/require xulrunner 2.0+<br />
    * Support linking againgst libwebkit-gtk3 (-DWITH_WEBKIT3=ON)<br />
    * Port to gsettings for gnome3. (-DWITH_GNOME3=ON[default])<br />
    * Issues closed:<br />
      &#8211; #149: always test for the right python noarch module path<br />
      &#8211; #155: Cannot compile with Firefox 4<br />
      &#8211; #156: libproxy should build against webkitgtk-3.0<br />
      &#8211; #158: Won&#8217;t compile w/ xulrunner 2.0 final<br />
      &#8211; #159: libproxy fails with autoconfiguration &#8220;http://proxy.domain.com&#8221;<br />
      &#8211; #131: GSettings-based GNOME plugin<br />
      &#8211; #150: SUSE sysconfig/proxy config support</p>
<p>Packages for opoenSUSE Factory are already in their works and have been submitted for inclusion. That means that we will finally get all the apps supporting libproxy read the gnome3 proxy settings for us again.</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/06/libproxy-0-4-7-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GObject Introspection based typelib Provides and Requires</title>
		<link>http://dominique.leuenberger.net/blog/2011/06/gobject-introspection-based-typelib-provides-and-requires/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/06/gobject-introspection-based-typelib-provides-and-requires/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 18:44:23 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[GNOME]]></category>
		<category><![CDATA[openSUSE]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=194</guid>
		<description><![CDATA[In a constant battle to improve the quality of the packages provided by the openSUSE GNOME Team, we have been working hard on additional automatism in adding Provides and Requires symbols to our packages. This will make it less common to be able to install a package without the needed libraries. A common scenario could [...]]]></description>
			<content:encoded><![CDATA[<p>In a constant battle to improve the quality of the packages provided by the openSUSE GNOME Team, we have been working hard on additional automatism in adding Provides and Requires symbols to our packages.<br />
This will make it less common to be able to install a package without the needed libraries.</p>
<p><strong>A common scenario could have been (It was luckily not that common, but was possible to happen):</strong><br />
- The game &#8220;lightsoff&#8221; was installed. It did not have dependencies on various libraries. rpm was not able to identify any requirements, as the game is written in JavaScript and uses seed as its interpreter. But of course it makes full use of gobject-introspection based bindings of a good part of gnome libraries (GTK, Clutter, GConf, just to name a few).<br />
<span id="more-194"></span><br />
Now, those libraries all offer a .typelib which is a bindings file, created with object-introspection and we used this knowledge to make dependencies between the packages.</p>
<p>The provides part is rather simple: every .typelib file is one Provides for rpm, the name itself can be split in all needed parts.<br />
The file &#8220;Gtk-3.0.typelib&#8221; for example represents a &#8220;Provides: typelib(Gtk) = 3.0&#8243; in the rpm package.</p>
<p>This part has now been pushed to Factory (review pending) and all libraries offering those bindings will hopefully shortly start to advertise this in their rpm metadata..</p>
<p><strong>What needs to be done to achieve this?</strong><br />
If your package contains a .typelib file together with the library (it should be packaged in the shared library package), then you should make sure to add gobject-introspection BuildRequires in your .spec file. This installs the needed hooks for rpm to know how to scan those files and creates the Provides.</p>
<p><strong>What next?</strong><br />
Once we get a full Factory build with those provides, we will evaluate on how much is going to break when we enable the Requires parser as well (it is already enabled in GNOME:Factory, with a bunch of failures for now).<br />
Generally, the checks have been well tested and for all current failures in G:F we know that it is simply missing the build in Factory, as it&#8217;s libraries not provided by Gnome (PolKit for example).</p>
<p>So hopefully not too far in the future, we will push the Requires parser as well and not break too much.</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/06/gobject-introspection-based-typelib-provides-and-requires/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>how to fix brp and rpmlint warnings – today: I: Statement might be overflowing a buffer in strncat.</title>
		<link>http://dominique.leuenberger.net/blog/2011/05/how-to-fix-brp-and-rpmlint-warnings-%e2%80%93-today-i-statement-might-be-overflowing-a-buffer-in-strncat/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/05/how-to-fix-brp-and-rpmlint-warnings-%e2%80%93-today-i-statement-might-be-overflowing-a-buffer-in-strncat/#comments</comments>
		<pubDate>Sat, 28 May 2011 14:02:05 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[lint / brp series]]></category>
		<category><![CDATA[obs]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=189</guid>
		<description><![CDATA[Malcolm Lewis sent me a link to one of his failing packages, with the idea to bring the next post for this series (which has had a too long break already). So Malcolm: Thank you for the heads up and here we go with another hopefully helpful solution to one of brp error (brp actually [...]]]></description>
			<content:encoded><![CDATA[<p>Malcolm Lewis sent me a link to one of his failing packages, with the idea to bring the next post for this series (which has had a too long break already). So Malcolm: Thank you for the heads up and here we go with another hopefully helpful solution to one of brp error (brp actually stands for Build Root Policy)</p>
<p>So, just like before, we have a look at the error, including the specific code parts raising the errors:</p>
<blockquote><p>I: Statement might be overflowing a buffer in strncat. Common mistake:<br />
   BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument<br />
   GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
</p></blockquote>
<p>Ok, so the error is very helpful with even telling us what is a bad use of strncat and what a good use of it would look like. For completeness, let&#8217;s see what the compiler itself reports on this error:</p>
<blockquote><p>In function &#8216;strncat&#8217;,<br />
    inlined from &#8216;gtkui_icmp_redir&#8217; at ec_gtk_mitm.c:173:14:<br />
/usr/include/bits/string3.h:152:3: warning: call to __builtin___strncat_chk might overflow destination buffer [enabled by default]
</p></blockquote>
<p>Let&#8217;s see what <strong><a href="http://linux.die.net/man/3/strncat">man 3 strncat</a></strong> tells us about the usage of strncat.</p>
<blockquote><p><strong>Synopsis</strong></p>
<p>#include <string.h><br />
char *strcat(char *dest, const char *src);<br />
char *strncat(char *dest, const char *src, size_t n);</p>
<p><strong>Description</strong><br />
The strcat() function appends the src string to the dest string overwriting the &#8216;\0&#8242; character at the end of dest, and then adds a terminating &#8216;\0&#8242; character. The strings may not overlap, and the dest string must have enough space for the result.</p>
<p>The strncat() function is similar, except that it will use at most n characters from src. Since the result is always terminated with &#8216;\0&#8242;, at most n+1 characters are written. </p></blockquote>
<p>The package suggested by Malcolm contains this code (snipped together):</p>
<p><code>#define PARAMS_LEN   50<br />
static char params[PARAMS_LEN];</p>
<p>      strncat(params, gtk_entry_get_text(GTK_ENTRY(entry1)), PARAMS_LEN);<br />
      strncat(params, "/", PARAMS_LEN);<br />
      strncat(params, gtk_entry_get_text(GTK_ENTRY(entry2)), PARAMS_LEN);</code></p>
<p>This is not an uncommon error at all. We create a buffer, 50 chars long, we concatenate text into the buffer and specify a max length of PARAMS_LEN. What is not taken into account here is that the string in params is getting longer, and we do not account for this when adding text to it. And additionally the leading \0 is ignored as well.</p>
<p>Translating the BRP Result&#8217;s suggestion stating how we should write this code, we will result in this:<br />
<code>#define PARAMS_LEN   50<br />
static char params[PARAMS_LEN];</p>
<p>      strncat(params, gtk_entry_get_text(GTK_ENTRY(entry1)), sizeof(params)-strlen(params)-1);<br />
      strncat(params, "/", sizeof(params)-strlen(params)-1);<br />
      strncat(params, gtk_entry_get_text(GTK_ENTRY(entry2)), sizeof(params)-strlen(params)-1);</code></p>
<p>sizeof(params) is what we had there before, and equals to PARAMS_LEN. But we now also take into account that we already do have some characters stored in params and also account for a trailing NULL byte.</p>
<p>And with this simple fix, the error vanished.</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/05/how-to-fix-brp-and-rpmlint-warnings-%e2%80%93-today-i-statement-might-be-overflowing-a-buffer-in-strncat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>how to fix brp and rpmlint warnings – today:I: Program causes undefined operation(likely same variable used twice and post/pre incremented in the same expression)</title>
		<link>http://dominique.leuenberger.net/blog/2011/03/how-to-fix-brp-and-rpmlint-warnings-%e2%80%93-todayi-program-causes-undefined-operationlikely-same-variable-used-twice-and-postpre-incremented-in-the-same-expression/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/03/how-to-fix-brp-and-rpmlint-warnings-%e2%80%93-todayi-program-causes-undefined-operationlikely-same-variable-used-twice-and-postpre-incremented-in-the-same-expression/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 23:00:31 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[lint / brp series]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[obs]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=178</guid>
		<description><![CDATA[It seems the planned series sort of finds an audience, which in turn of course is motivational to keep on writing it. Today, we&#8217;ll have a look at this Informational message in BRP checks: I: Program causes undefined operation (likely same variable used twice and post/pre incremented in the same expression). e.g. x = x++; [...]]]></description>
			<content:encoded><![CDATA[<p>It seems the planned series sort of finds an audience, which in turn of course is motivational to keep on writing it. Today, we&#8217;ll have a look at this Informational message in BRP checks:<br />
<blockquote>I: Program causes undefined operation<br />
   (likely same variable used twice and post/pre incremented in the same expression).<br />
   e.g. x = x++; Split it in two operations.</p></blockquote>
<p>This is currently informational only and is not failing the build, but you might want to address them together with upstream.</p>
<p>I assume you do know what &#8220;a++&#8221; means in C (otherwise, you should start reading C-books), so we just try to reproduce this error in a simple c test case:<br />
<code>#include &lt;stdio.h&gt;</p>
<p>int main() {<br />
  int i=5;<br />
  i = i++ * ++i;<br />
  printf("The current value of i is %d\n", i);<br />
  return 0;<br />
}<br />
</code></p>
<p>When building this using gcc -Wall test.c, we get this compiler warning (which in turn is what brp translates to the information we&#8217;re discussing here)</p>
<blockquote><p>> gcc -Wall test2.c<br />
test.c: In function ‘main’:<br />
test.c:5:5: warning: operation on ‘i’ may be undefined
</p></blockquote>
<p>So, let&#8217;s first see for ourselves what we would expect this to be? Hmm.. already for us, this looks not logic (and I surely hope nobody would write this code).<br />
Let&#8217;s just see what starting this executable gives shall we?</p>
<blockquote><p>The current value of i is 37</p></blockquote>
<p>Now, is this surprising? We multiplied, assigned it to i and as a result we get a prime number? By closely analyzing the line you will likely understand what the compiler did. But was this expected? If this is actually what the programmer intended, the code should just be rewritten to be more logical, like:<br />
<code>i = (i+1) ^2 + 1;</code><br />
This is understandable for all of us and does not yield the surprise of what is going on.</p>
<p>And that is actually all this warning is about: it requests the programmer to write code that can be understood and does not depend on what the compiler interprets. It might even very well be that the different optimization levels or the usage of different compilers might end up in different results.</p>
<p>If you want to read some more about this topic, I suggest to have a look at:<br />
<a href="http://en.wikipedia.org/wiki/Sequence_point">Wikipedia</a><br />
<a href="http://publications.gbdirect.co.uk/c_book/chapter8/sequence_points.html">http://publications.gbdirect.co.uk/c_book/chapter8/sequence_points.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/03/how-to-fix-brp-and-rpmlint-warnings-%e2%80%93-todayi-program-causes-undefined-operationlikely-same-variable-used-twice-and-postpre-incremented-in-the-same-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to fix brp and rpmlint warnings &#8211; today: Expression compares a char* pointer with a string literal</title>
		<link>http://dominique.leuenberger.net/blog/2011/03/how-to-fix-brp-and-rpmlint-warnings-today-expression-compares-a-char-pointer-with-a-string-literal/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/03/how-to-fix-brp-and-rpmlint-warnings-today-expression-compares-a-char-pointer-with-a-string-literal/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 22:29:55 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[lint / brp series]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[obs]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=151</guid>
		<description><![CDATA[After having seen this kind of question several times, I think it could be interesting to start creating a small &#8216;series of rpmlint errors and their typical fixes&#8221;. Interested in it? So welcome to part #1 (this issue). The &#8220;series&#8221; is not really fledged out, but I will try to write post for various errors [...]]]></description>
			<content:encoded><![CDATA[<p>After having seen this kind of question several times, I think it could be interesting to start creating a small &#8216;series of rpmlint errors and their typical fixes&#8221;.</p>
<p>Interested in it? So welcome to part #1 (this issue). The &#8220;series&#8221; is not really fledged out, but I will try to write post for various errors / topics, as they come along. Just drop me a note with an error you have seen / experienced in OBS while building a package.</p>
<p>So what does it mean, if OBS tells you this:<br />
Expression compares a char* pointer with a string literal. Usually a strcmp() was intended by the programmer</p>
<p>Let&#8217;s have a look at a very simple C program, to show the issue:<br />
<code>#include &lt;stdio.h&gt;</p>
<p>int main() {<br />
  char *mytext;<br />
  mytext = "Help";<br />
  if (mytext == "Help") {<br />
    printf("This should raise a warning");<br />
  }<br />
  return 0;<br />
}</code>Trying to compile this very simple C program, which on first sight many would probably say this is correct, will result in this:</p>
<blockquote><p>
$ gcc test1.c -Wall<br />
test1.c: In function ‘main’:<br />
test1.c:6:14: warning: comparison with string literal results in unspecified behavior
</p></blockquote>
<p>So, even though we had such an easy program, line 6 seems to be an issue for us:</p>
<blockquote><p>if (mytext == &#8220;Help&#8221;) {</p></blockquote>
<p>The issue, as simple as it may sound, is the comparison of a pointer (char *) with a literal (&#8220;Help&#8221;).</p>
<p>So how do we fix it? It involves changing the code, thus writing a patch (there are many good helps around for this&#8230; I won&#8217;t dive into patching here).. Of course, after having written a patch, be a good downstream, send it upstream!<br />
What you want to do here is to replace this comparison with strcmp (just as OBS&#8217; error message implied).<br />
Look at this code now:<br />
<code>#include &lt;stdio.h&gt;<br />
#include &lt;string.h&gt;</p>
<p>int main() {<br />
  char *mytext;<br />
  mytext = "Help";<br />
  if (strcmp(mytext,"Help")==0) {<br />
    printf("No warning here\n");<br />
  }<br />
  return 0;<br />
}</code>I changed <em>&#8220;mytext == &#8220;Help&#8221;</em> to <em>strcmp(mtext,&#8221;Help&#8221;)==0</em> (<a href="http://linux.die.net/man/3/strcmp">man 3 strcmp</a> will explain you why&#8230; 0 means the texts are equal, or &#8217;0 difference detected&#8217; can help you remember that). As the code was too simple and strcmp was not yet defined (this of course can also happen in packages you patch), I had to add an additional <em>#include &lt;string.h&gt;</em>.</p>
<p>Not too hard, is it?</p>
<p>So what do you think? Such a series of &#8220;how to fix my typical brp / lint warnings&#8221; useful?</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/03/how-to-fix-brp-and-rpmlint-warnings-today-expression-compares-a-char-pointer-with-a-string-literal/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>VLC / openSUSE 11.0 repository to be removed</title>
		<link>http://dominique.leuenberger.net/blog/2011/02/vlc-opensuse-11-0-repository-to-be-removed/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/02/vlc-opensuse-11-0-repository-to-be-removed/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 16:02:02 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[VideoLAN Client]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=149</guid>
		<description><![CDATA[openSUSE 11.0 has been End-Of_life for a good while already, but the VLC Repository kept on being available for the users still relying on it. There have not been any updates and rebuilds for a long time (maintaining new versions became a nightmare, as underlying libraries started to be outdated). For this reason I&#8217;m hereby [...]]]></description>
			<content:encoded><![CDATA[<p>openSUSE 11.0 has been End-Of_life for a good while already, but the VLC Repository kept on being available for the users still relying on it. There have not been any updates and rebuilds for a long time (maintaining new versions became a nightmare, as underlying libraries started to be outdated).</p>
<p>For this reason I&#8217;m hereby announcing that the 11.0 repositories will be removed from the videolan download infrastructure by <strong>March 1st 2011</strong> ! If you rely on having the packages available for your personal installations, please make sure to create a local copy of the FTP tree.</p>
<p>On the bright side though: the 11.4 repository has just been uploaded. It is built against the latest snapshot of 11.4, which is somewhat between RC1 and RC2. Most likely not much is changing that would affect stability of the VLC packages. And like always of course: Factory package keep on existing. But they did for a long time already.</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/02/vlc-opensuse-11-0-repository-to-be-removed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enlightenment 1.0.0 for openSUSE</title>
		<link>http://dominique.leuenberger.net/blog/2011/02/enlightenment-1-0-0-for-opensuse/</link>
		<comments>http://dominique.leuenberger.net/blog/2011/02/enlightenment-1-0-0-for-opensuse/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 23:16:55 +0000</pubDate>
		<dc:creator>Dominique Leuenberger</dc:creator>
				<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[Enlightenment]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://dominique.leuenberger.net/blog/?p=142</guid>
		<description><![CDATA[It&#8217;s been a long time since I was in touch with Enlightenment, back in the young days I used it as my first alternative Desktop Environment on Windows, before actually daring to switch to Linux. Today I hear that version 1.0.0 of the core libraries have been released. Reason enough to actually look into this [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since I was in touch with Enlightenment, back in the young days I used it as my first alternative Desktop Environment on Windows, before actually daring to switch to Linux.</p>
<p>Today I hear that version 1.0.0 of the core libraries have been released. Reason enough to actually look into this again. So 1 hour, many build failures and successes later, I have the entire core-stack built in my obs repository home:dimstar:Enlightenment. The window manager Enlightenment itself is not yet released as full release, but the latest snapshot can be found in my repo as well.</p>
<p>But that&#8217;s it so far: all core libraries are built. Nothing more. I did not even have time to test them yet.</p>
<p>If you feel adventurous, go, add the repository obs://home:dimstar:Enlightenment to your system (published for openSUSE 11.3 and Factory) and start playing with all of the things, starting with the window manager, which should generally pull in the rest.</p>
<p>What should be required (as root)<br />
<code>zypper ar obs://home:dimstar:Enlightenment Enlightenment<br />
zypper in enlightenment</code></p>
<p>This will add my home repository to your catalog list and install enlightenment including dependencies. One logout later, you should see Enlightenment as a new session type in your *DM.</p>
<p>Have a lot of fun and share your experiences&#8230;  I will test it after I get some sleep.</p>
]]></content:encoded>
			<wfw:commentRss>http://dominique.leuenberger.net/blog/2011/02/enlightenment-1-0-0-for-opensuse/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

