This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix warning about duplicate 'const'
"Joseph S. Myers" <jsm@polyomino.org.uk> writes:
| Simpler to restrict the pedwarns for duplicate qualifiers to (pedantic &&
| !flag_isoc99) (in all the various cases warned for) and document this as
| an extension from C99 that is accepted in C89/C90 mode.
I would suggest the existing practice (in nearby language) for this:
(1) reject "direct" duplicate cv-qualifiers, .e.g.
const const int i = 90; // ERROR
(2) accept duplicates that come from typedefs, e.g.
typedef const int T;
const T t = 3889; // OK
and document that as a GNU extension to C90, and compatible with C++.
-- Gaby