define - IF
#1

Hello,

I have this code:
Код:
#define IF_TRUE(%0)  if((%0))
I using this like this:
Код:
    IF_FALSE(true) {
		printf("Sdasdsa");
	}
And the warning:
warning 205: redundant code: constant expression is zero

What do to?
Reply
#2

What is this?
And what is it doing? (should do) ?
Reply
#3

Try to understand... check if the param is false..
Reply
#4

This doesn't make any sense whatsoever. An if-statement always needs to evaluate to true for the code in the block to be executed. If you need to invert the statement, use the NOT operator (exclamation mark).
Reply
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
This doesn't make any sense whatsoever. An if-statement always needs to evaluate to true for the code in the block to be executed. If you need to invert the statement, use the NOT operator (exclamation mark).
Please, don't commant if you not helping.

You must look on the code befor commant, I want to do define that have IF...
Reply
#6

Still, I do not understand what it is that you're actually trying to achieve. This isn't something a professional programmer would ever consent to write.

You might want to do something about your English as well. "I want to do define that have IF..." is not an understandable sentence.
Reply
#7

The warning just tells you, that this code phrase is useless, as its behaviour is already known on compilation, and so could also be left out.
It doesnt cause any problems however, you can just ignore it if you want to produce inefficient but still working code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)