https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082009-12-16T07:32:52ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #1629: git: Add -Werror to the kernel build.https://bugs.dragonflybsd.org/issues/1629?journal_id=79342009-12-16T07:32:52Zaoiko
<ul></ul><p>Joel K. Pettersson wrote:</p>
<blockquote>
<p>On Tue, Dec 15, 2009 at 2:52 PM, Sascha Wildner<br /><<a class="email" href="mailto:swildner@crater.dragonflybsd.org">swildner@crater.dragonflybsd.org</a>> wrote:</p>
<blockquote>
<p>commit 40ec0564adaa677a0dab5299bdd491a2245e94a0<br />Author: Sascha Wildner <<a class="email" href="mailto:saw@online.de">saw@online.de</a>><br />Date: Tue Dec 15 15:52:07 2009 +0100</p>
<p>Add -Werror to the kernel build.<br />[...]</p>
</blockquote>
<p>I'd guess the following is probably related to this. Anyhow:</p>
<p>A user following the development changes of DragonFly, I noted that<br />building the kernel now errors out due to warnings of unused variables<br />- the ones in question being used only by debug code (KKASSERT, etc.),<br />and my kernel config disabling debug options.</p>
</blockquote>
<p>I don't think that's the proper way to deal with variables that are only<br />used in debug statements.</p>
<p>We should add something like this:</p>
<p>#ifndef INVARIANTS<br />#define <i>debug_var __attribute</i>((unused))<br />#else<br />#define __debug_var<br />#endif</p>
<p>and then use</p>
<p>int a __debug_var;</p>
<p>for such variables.</p>
<p>Aggelos</p> DragonFlyBSD - Bug #1629: git: Add -Werror to the kernel build.https://bugs.dragonflybsd.org/issues/1629?journal_id=79352009-12-16T08:38:47Zswildner
<ul></ul><p>Am 16.12.2009 00:28, schrieb Aggelos Economopoulos:</p>
<blockquote>
<p>I don't think that's the proper way to deal with variables that are only<br />used in debug statements.</p>
<p>We should add something like this:</p>
<p>#ifndef INVARIANTS<br />#define <i>debug_var __attribute</i>((unused))<br />#else<br />#define __debug_var<br />#endif</p>
<p>and then use</p>
<p>int a __debug_var;</p>
<p>for such variables.</p>
</blockquote>
<p>That looks like a sound idea. I'm on it (testing kernel builds without <br />INVARIANTS at the moment).</p>
<p>Sascha</p> DragonFlyBSD - Bug #1629: git: Add -Werror to the kernel build.https://bugs.dragonflybsd.org/issues/1629?journal_id=79362009-12-16T16:54:13Zswildner
<ul></ul><p>Am 16.12.2009 00:14, schrieb Joel K. Pettersson:</p>
<blockquote>
<p>I'd guess the following is probably related to this. Anyhow:</p>
<p>A user following the development changes of DragonFly, I noted that<br />building the kernel now errors out due to warnings of unused variables<br />- the ones in question being used only by debug code (KKASSERT, etc.),<br />and my kernel config disabling debug options.</p>
<p>The following files have these warnings:</p>
<p>sys/kern/kern_lock.c<br />sys/kern/kern_sig.c<br />sys/kern/lwkt_thread.c<br />sys/kern/vfs_cache.c<br />sys/kern/vfs_syscalls.c<br />sys/vfs/nfs/nfs_vnops.c<br />sys/vfs/hammer/hammer_object.c<br />sys/vfs/hammer/hammer_subs.c<br />sys/platform/pc32/i386/pmap.c</p>
<p>I don't know if these fit the preferred style of solving this, but<br />diffs to remove the warnings (mostly adding #ifdef INVARIANTS) to make<br />it build attached. At any rate, having a look at it will quickly show<br />where it's located.</p>
</blockquote>
<p>I think I've fixed it (as aggelos suggested). Can you try again with <br />latest master?</p>
<p>Sascha</p> DragonFlyBSD - Bug #1629: git: Add -Werror to the kernel build.https://bugs.dragonflybsd.org/issues/1629?journal_id=79382009-12-16T20:48:53Zjoelkp
<ul></ul><blockquote>
<p>I think I've fixed it (as aggelos suggested). Can you try again with <br />latest master?</p>
<p>Sascha</p>
</blockquote>
<p>It builds as expected.</p>
<p>Joel</p>