This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix warning about duplicate 'const'
- From: Andrew Haley <aph at redhat dot com>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: Linus Torvalds <torvalds at osdl dot org>, Thomas Schlichter <thomas dot schlichter at web dot de>, Andrew Morton <akpm at osdl dot org>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org
- Date: Wed, 10 Mar 2004 18:29:43 +0000
- Subject: Re: [PATCH] fix warning about duplicate 'const'
- References: <200403090043.21043.thomas.schlichter@web.de><20040308161410.49127bdf.akpm@osdl.org><Pine.LNX.4.58.0403081627450.9575@ppc970.osdl.org><200403090217.40867.thomas.schlichter@web.de><Pine.LNX.4.58.0403081728250.9575@ppc970.osdl.org><20040310054918.GB4068@twiddle.net><Pine.LNX.4.58.0403100740120.1092@ppc970.osdl.org><20040310182227.GA6647@twiddle.net>
Richard Henderson writes:
> On Wed, Mar 10, 2004 at 07:43:10AM -0800, Linus Torvalds wrote:
> > Ok, let's try just stripping the "const" out of the min/max macros, and
> > see what complains.
>
> I remember what complains. You get actual errors from
>
> const int x;
> int y;
> min(x, y);
Can you explain *why* we have to produce a diagnostic for "const const
int" by default?
Can't we dispatch such things to "-pedantic" ? Or treat "const const"
like "long long" used to be, a gcc extension?
Andrew.