GNOME Bugzilla – Bug 69655
Lots of redundant declarations
Last modified: 2009-08-15 18:40:50 UTC
If you compile with -Wredundant-decls (I used gcc 2.95), you get pages of warnings because of redundant functions declarations. Most of them are redundant decls in different files (like parser.h and global.h), but some of them are in the same file. See parserInternals.h for example, lines 192 and 194... It doesn't make the code crash, but makes it obscure, and is prone to bugs if any change need to be done.
Grumble ... I disagree with the premice "makes it obscure, and is prone to bugs" especially in the presence of -Wimplicit and the Severity level as "normal". Anyway I did it, fixed in CVS. Not sure it changes that much. I was already compiling with -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline I now compile with -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls I assume you are subcribed to the list and that you will help the people who will have problems because the APIs are now defined by a smaller set of includes. I accept when people try to give lessons but they need to share the associate work, isn't it ! I people have troubles and you don't help I will likely revert the changes back. thanks a lot in advance for your future help ! Daniel
Thanks for fixing it. I didn't intend to give lessons, sorry if it felt like it; I actually started fixing it myself, but then I realize it was quite big and I didn't know the code arch enough. Yes, I'm on the list.
According to Jody Goldberg, this already broke in the Gnome CVS: gconf, gnome-print, gtkhtml2, nautilus and gnumeric I.e. nearly everything :-\ I have tried to make a second pass to keep the original semantic of the includes, but it's hard to make any guarantee. If I can't fix the problem quickly, I'm afraid I will have to revert part of it ... Daniel
Well I fixed the includes again, and it seems to have corrected the problem, so this change has made into the 2.4.15 release. I hope it won't give too many troubles, Daniel