Re: [PATCH] fix warning about duplicate 'const'

From: Linus Torvalds
Date: Mon Mar 08 2004 - 20:27:49 EST




On Tue, 9 Mar 2004, Thomas Schlichter wrote:
>
> Am Dienstag, 9. März 2004 01:32 schrieb Linus Torvalds:
>
> ~~ snip ~~
>
> > 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.
>
> OK, I tested it and gcc 3.3.1 does not complain about this. So with my patch,
> the duplicate 'const' warning goes away here and no other warning occours...

Yeah, but do keep in mind that "something like" comment. I'm by no means
sure that I remembered the exact reason correctly, and maybe they aren't
really needed.

Also, I'm not convinced this isn't a gcc regression. It would be stupid to
"fix" something that makes old gcc's complain, when they may be doing the
right thing.

All that code was from early 2002 (around 2.4.9), so maybe somebody can
find the full discussion on the linux-kernel archives from January 2002 or
so?

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