[ok] code question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

[ok] code question

Post by stefbuet »

Hi,

I'm using some zip functionalities from an external source code I didn't write.
I've some warning compiling it with gcc and I would like to avoid those, but I'm not sure about it.

I have multiple warning like that : [Warning] statement has no effect.
I don't understand what the corresponding lines are doing... looks like a macro but...

[Warning] statement has no effect.
lines : 746, 757, 851, 860, 872, 1009, 1077, [...]. (from cpp file)

Code here :
http://pastebin.com/zQ3QwVV4
header : http://pastebin.com/rNThEDyF

Thanks for your help.
Last edited by stefbuet on Sun Jul 10, 2011 9:15 am, edited 1 time in total.
CuteAlien wrote:coders are well-known creatures of the night
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Re: code question

Post by Sylence »

The first two warnings are coming from this macro:

Code: Select all

#define LOADOUT {q=s->write;m=(uInt)WAVAIL;m;}
I don't see any sense in the last statement (m;) and so does your compiler ;)

That's the reason why macro functions are evil ;)
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Re: code question

Post by stefbuet »

Thanks.
Yeah this is strange there were 3 useless instructions like that...
I'm wondering why. The author of this code is not a newbie.
CuteAlien wrote:coders are well-known creatures of the night
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: code question

Post by hendu »

Workarounds for crappy compilers. Also macros are evil.
Post Reply