2003-02-04 Matthew Wilcox * c-decl.c: Only warn about multiple const, restrict or volatile in -std=c89 mode, not in -std=gnu89. Index: gcc/c-decl.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/c-decl.c,v retrieving revision 1.361 diff -u -r1.361 c-decl.c --- gcc/c-decl.c 24 Jan 2003 15:17:24 -0000 1.361 +++ gcc/c-decl.c 4 Feb 2003 16:13:13 -0000 @@ -3805,12 +3805,15 @@ restrictp = !! (specbits & 1 << (int) RID_RESTRICT) + TYPE_RESTRICT (type); volatilep = !! (specbits & 1 << (int) RID_VOLATILE) + TYPE_VOLATILE (type); inlinep = !! (specbits & (1 << (int) RID_INLINE)); - if (constp > 1 && ! flag_isoc99) - pedwarn ("duplicate `const'"); - if (restrictp > 1 && ! flag_isoc99) - pedwarn ("duplicate `restrict'"); - if (volatilep > 1 && ! flag_isoc99) - pedwarn ("duplicate `volatile'"); + if (flag_iso && ! flag_isoc99) + { + if (constp > 1) + pedwarn ("duplicate `const'"); + if (restrictp > 1) + pedwarn ("duplicate `restrict'"); + if (volatilep > 1) + pedwarn ("duplicate `volatile'"); + } if (! flag_gen_aux_info && (TYPE_QUALS (type))) type = TYPE_MAIN_VARIANT (type); type_quals = ((constp ? TYPE_QUAL_CONST : 0) .