at the level of the ILO AND by comparison

Hello

I discovered one - I think - strange behavior of my ICB 8.5.1 compiler and I wanted to ask your comments about it.

Try this in the interactive execution window (it will result in a popup go as expected):

#include
public static unsigned short = 0 w x 8101;

If (w & 0 x 1800) {MessagePopup ('fail', 'fail') ;}}
else {MessagePopup ('pass', 'pass') ;}}

Now, try this:

#include
public static unsigned short = 0 w x 8101;

If (w & 0 x 1800! = 0) {MessagePopup ('fail', 'fail') ;}}
else {MessagePopup ('pass', 'pass') ;}}

It says do not? Well well, that happens to me.

Cast 1800 x 0 or 0 to unsigned short does not work.

I could only get the second excerpt only by changing the 0 x 0 8101 8100 w?

How can the world the result of these two operations differ: (0 x 8101 & 0 x 1800); (0 x 8100 & 0 x 1800).

Other pieces of 0 x 8101 compensation, incidentally, I mean change in 0 x 0101 or 0x8001 doesn't help either.

The behavior is the same for 8.0.1 and 6.0 versions.

Is it a problem of language C I'm not yet aware of the or a compiler "bug"?

In C, operator ! = has a higher precedence than &, so the expression is evaluated as:

w & (0 x 1800! = 0)

What is true if x 8101 w = 0.

Tags: NI Software

Similar Questions

Maybe you are looking for