This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Obsolete pedwarns in c-decl.c:grokdecl
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Obsolete pedwarns in c-decl.c:grokdecl
- From: Greg McGary <gkm at eng dot ascend dot com>
- Date: Thu, 16 Sep 1999 00:08:15 -1000
grokdecl contains these, in two places:
if (constp > 1)
pedwarn ("duplicate `const'");
if (volatilep > 1)
pedwarn ("duplicate `volatile'");
if (restrictp > 1)
pedwarn ("duplicate `restrict'");
if (xboundedp > 1)
However, in c9x 6.7.3:
[#4] If the same qualifier appears more than once in the
same specifier-qualifier-list, either directly or via one or
more typedefs, the behavior is the same as if it appeared
only once.
So, there's no need to issue a diagnostic. I don't have a copy of
c89, so I can only guess that a diagnostic was required for duplicated
qualifiers. How should I fix this? Drop the pedwarns completely?
Append `&& !flag_isoc9x' to the condition? Other?
Clearly the pedwarns should go for `restrict', since it only exists in
C9X where duplicates are OK.