Unused parameters

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

dmail
Quite a regular
Quite a regular
Posts: 46
Joined: Mon Nov 27, 2006 16:49

Unused parameters

Postby dmail » Fri Dec 12, 2008 16:25

I am sure I have posted this request here before, but anyway can you please fix the source to not generate multiple unneeded warnings. For example in ceguilogger.h

Code: Select all

private:
   /*************************************************************************
      Copy constructor and assignment usage is denied.
   *************************************************************************/
   Logger(const Logger& logger) : Singleton <Logger>() {}
   Logger& operator=(const Logger& logger) {return *this;}

Would be better as

Code: Select all

   Logger(const Logger&) ;
   Logger& operator=(const Logger&);

As they are not callable if for some reason you do not want to do this then atleast use the following

Code: Select all

   Logger(const Logger& logger) : Singleton <Logger>() {(void)logger;}
   Logger& operator=(const Logger& logger) {(void)logger;return *this;}

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Dec 12, 2008 19:31

Hi,

Which compiler are you using and which settings do you have to use to see the warnings? I'd like to see these warnings, because so far I do not ever remember seeing any warnings relating to this.

CE.

dmail
Quite a regular
Quite a regular
Posts: 46
Joined: Mon Nov 27, 2006 16:49

Postby dmail » Sun Dec 14, 2008 12:02

Visual Studio 8 and 9 using warning level W4, gcc should also give the same warnings using something like -Wall -pedantic although I have not compiled CEGUI using gcc yet.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Dec 14, 2008 12:26

Thanks for the info, I'll take a look.

Btw, when I work on svn trunk I use gcc with -Wall -ansi -pedantic and get no warnings relating to this, I'll find out which setting I do need and start using that too :)

[Edit]
-Wextra does the trick ;)

CE.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Sun Dec 14, 2008 22:33

the strange thing is that -Wall is *not* all warnings at all ...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Dec 15, 2008 09:40

Pompei2 wrote:the strange thing is that -Wall is *not* all warnings at all ...

Yeah, it's really easy to be thrown by this - perhaps historically it used to be all warnings, but as things have progressed they're not adding all new warnings to be included with -Wall, or something. I might look into the history of this, should be interesting (yes, I really am that sad :) ).

CE.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Dec 15, 2008 19:45

Hehe tell me if you find out something.

Also, I would like to note that I would compile every app/lib both with gcc AND with visual studio, as each one prints some (very useful) warnings that the other one does not. Both helped me find bugs with their warnings already.

Sry if it goes a little off-topic :)

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Tue Dec 16, 2008 11:07

BTW, I tried it out with -Wextra and I get A LOT of warnings about "unused parameter" when compiling CEGUI (not the trunk).

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Dec 16, 2008 11:29

Yeah, there's quite a few of them ;) I'll definitely get them sorted out, the main priority has to be to remove the warnings coming from the header files, this way client code can be compiled without CEGUI causing a million warnings to spew forth, which is really bad form I must admit.

No news on the history of -Wall yet ;)

CE.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Tue Dec 16, 2008 12:11

CrazyEddie wrote:Yeah, there's quite a few of them ;) I'll definitely get them sorted out, the main priority has to be to remove the warnings coming from the header files, this way client code can be compiled without CEGUI causing a million warnings to spew forth, which is really bad form I must admit.

Good news. I know that resolving all those warnings won't change anyting in CEGUI, is boring to do, but I think that is one of the things that separate a "clean" library from a "hacked" library.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Dec 16, 2008 13:50

Yeah, I agree. There's nothing worse than when trying to fix warnings in your own code, you have to sift though a whole bunch that come from the fact you just included some external header.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 17 guests