lkml.org 
[lkml]   [2004]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix warning about duplicate 'const'


On Mon, 8 Mar 2004, Andrew Morton wrote:
> >
> > This is done by removing the 'const' from the temporary variables of the min()
> > and max() macros. For me it seems to have no negative impact, so please
> > consider applying...
>
> I think there was a reason for those consts in kernel.h's min() and max()
> macros, but memory fails me. Linus, do you recall?

I'm not 100% sure, but I think they are required to make a few other
warnings go away. The fact that gcc complains about "const typeof" is a
gcc misfeature, I think, and should be fixed there.

The warnings the extra "const" fixes is something like:

int a;
const int b;

min(a,b)

where otherwise it would complain about pointers to different types when
comparing the type of the pointer. Or something.

Linus
-
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: 2009-11-18 23:46    [W:0.051 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site