This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Question about some declarations
- From: Andreas Jaeger <aj at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 Jun 2003 08:42:13 +0200
- Subject: Question about some declarations
I bootstrap now with -Wredundant-decls and got a number of warnings
that I do not directly know how to handle:
Where should these get declared?
/cvs/gcc/gcc/regs.h:163: warning: redundant redeclaration of `reg_names' in same scope
/cvs/gcc/gcc/hard-reg-set.h:489: warning: previous declaration of `reg_names'
regs.h includes hard-reg-set.h, so one of them is definitly redundant.
And what about these?
/cvs/gcc/gcc/flags.h:26: warning: redundant redeclaration of `main_input_filename' in same scope
/cvs/gcc/gcc/input.h:43: warning: previous declaration of `main_input_filename'
/cvs/gcc/gcc/rtl.h:2260: warning: redundant redeclaration of `rshift_double' in same scope
/cvs/gcc/gcc/tree.h:2754: warning: previous declaration of `rshift_double'
/cvs/gcc/gcc/rtl.h:2319: warning: redundant redeclaration of `fancy_abort' in same scope
/cvs/gcc/gcc/tree.h:3020: warning: previous declaration of `fancy_abort'
/cvs/gcc/gcc/rtl.h:2110: warning: redundant redeclaration of `print_rtl' in same scope
/cvs/gcc/gcc/tree.h:2857: warning: previous declaration of `print_rtl'
/cvs/gcc/gcc/rtl.h:2244: warning: redundant redeclaration of `add_double' in same scope
/cvs/gcc/gcc/tree.h:2738: warning: previous declaration of `add_double'
/cvs/gcc/gcc/rtl.h:2247: warning: redundant redeclaration of `neg_double' in same scope
/cvs/gcc/gcc/tree.h:2741: warning: previous declaration of `neg_double'
And there more shared between rtl.h and tree.h.
/cvs/gcc/gcc/toplev.h:33: warning: redundant redeclaration of `print_time' in same scope
/cvs/gcc/gcc/timevar.h:92: warning: previous declaration of `print_time'
/cvs/gcc/gcc/toplev.h:98: warning: redundant redeclaration of `progname' in same scope
/cvs/gcc/gcc/cpplib.h:415: warning: previous declaration of `progname'
Since we have a prototype in getopt.h, I suggest to remove it from system.h:
/cvs/gcc/gcc/system.h:306: warning: redundant redeclaration of `getopt' in same scope
/cvs/gcc/include/getopt.h:113: warning: previous declaration of `getopt'
Neil, were should warnings get declared?
/cvs/gcc/gcc/flags.h:123: warning: redundant redeclaration of `warn_unknown_pragmas' in same scope
/cvs/gcc/gcc/c-common.h:502: warning: previous declaration of `warn_unknown_pragmas'
And then we have warnings like:
tm-preds.h:58: warning: redundant redeclaration of `register_and_not_fp_reg_operand' in same scope
/cvs/gcc/gcc/config/i386/i386-protos.h:54: warning: previous declaration of `register_and_not_fp_reg_operand'
Can we get rid of i386-protos.h (or at least everything that's in tm-preds.h)?
Andreas
--
Andreas Jaeger, SuSE Linux AG, aj@suse.de, http://www.suse.de/~aj
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126