DragonFly BSD
DragonFly submit List (threaded) for 2009-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: git: Add -Werror to the kernel build.


From: Aggelos Economopoulos <aoiko@xxxxxxxxxxxxxx>
Date: Wed, 16 Dec 2009 01:28:57 +0200

Joel K. Pettersson wrote:
> On Tue, Dec 15, 2009 at 2:52 PM, Sascha Wildner
> <swildner@crater.dragonflybsd.org> wrote:
>> commit 40ec0564adaa677a0dab5299bdd491a2245e94a0
>> Author: Sascha Wildner <saw@online.de>
>> Date:   Tue Dec 15 15:52:07 2009 +0100
>>
>>    Add -Werror to the kernel build.
>> [...]
> 
> I'd guess the following is probably related to this. Anyhow:
> 
> A user following the development changes of DragonFly, I noted that
> building the kernel now errors out due to warnings of unused variables
> - the ones in question being used only by debug code (KKASSERT, etc.),
> and my kernel config disabling debug options.

I don't think that's the proper way to deal with variables that are only
used in debug statements.

We should add something like this:

#ifndef INVARIANTS
#define __debug_var __attribute__((unused))
#else
#define __debug_var
#endif

and then use

int a __debug_var;

for such variables.

Aggelos



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]