By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Compilation Issue.

P: n/a
Hi,

I am writing code for an Atmega645. I use the IAR compiler (v4.2).
I noticed that this piece of the code was not working. Meaning even if
the if condition evaluated to 0, it did not enter the loop. I am not
sure if I cleaned up all the project files before issuing a build (but
I think I did). But I know I issued a build several time and observed
this problem at all times.
{
if ( !GetMessageCount() )
{
..........do something....

return;
}

....do something else....
return.
}

However, when I changed it to this, it worked.

{
if ( GetMessageCount() == 0)
{
..........do something....

return;
}

....do something else....
return.
}

Further, when I changed it back again, it worked properly !!!

How can you explain that?

Btw, GetMessageCount is defined below.
unsigned char GetMessageCount()
{
return MessageCount;
}

Aug 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ka**********@gmail.com wrote:
>
Further, when I changed it back again, it worked properly !!!
It looks like you have an issue with your build process, rather than with C.

--
Ian Collins.
Aug 7 '07 #2

P: n/a
On Aug 7, 12:01 pm, Ian Collins <ian-n...@hotmail.comwrote:
karthik.n...@gmail.com wrote:
Further, when I changed it back again, it worked properly !!!

It looks like you have an issue with your build process, rather than with C.

--
Ian Collins.
Can you elaborate? What might be going wrong?

Aug 8 '07 #3

P: n/a
ka**********@gmail.com <ka**********@gmail.comwrote:
On Aug 7, 12:01 pm, Ian Collins <ian-n...@hotmail.comwrote:
karthik.n...@gmail.com wrote:
Further, when I changed it back again, it worked properly !!!
It looks like you have an issue with your build process, rather than with C.

--
Ian Collins.

Can you elaborate? What might be going wrong?
Anything, as long as you don't tell what do you do to build.

M.
Aug 10 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.