This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Obsolete pedwarns in c-decl.c:grokdecl


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]