lkml.org 
[lkml]   [2003]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Avoiding "unused variable" warnings
Hi,

On 13 Jul 2003, Alan Cox wrote:

> > No need for a macro, just do
> >
> > (void) var_name;
> >
> > It doesn't generate any code, and it shuts up the compiler.
>
> It may do. The proper gcc thing is attribute unused. Both are dangerous
> as they hide when the variable becomes really unused

Function like macros, which throw away their arguments, can be dangerous.
I had a funny bug like this:

kunmap(*pagep++);

bye, Roman

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.023 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site