Compilation Issue.

Discussion in 'C Programming' started by karthik.naig@gmail.com, Aug 7, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. Ian Collins Guest

    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.
     
    Ian Collins, Aug 7, 2007
    #2
    1. Advertising

  3. Guest

    On Aug 7, 12:01 pm, Ian Collins <> wrote:
    > 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, 2007
    #3
  4. <> wrote:
    > On Aug 7, 12:01 pm, Ian Collins <> wrote:
    > > 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.
     
    Marcin Wolcendorf, Aug 10, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. thomson

    Compilation Issue

    thomson, Oct 5, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    421
    Juan T. Llibre
    Oct 6, 2005
  2. XD

    Compilation Issue ::

    XD, Aug 11, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    342
    David Wier
    Aug 11, 2006
  3. seema

    compilation issue

    seema, Mar 3, 2006, in forum: C++
    Replies:
    7
    Views:
    396
    Simon Elliott
    Mar 3, 2006
  4. mearvk

    Xerces Compilation Issue

    mearvk, Oct 3, 2007, in forum: C++
    Replies:
    5
    Views:
    427
    tragomaskhalos
    Oct 5, 2007
  5. C__chp
    Replies:
    4
    Views:
    547
    Puppet_Sock
    Feb 15, 2008
Loading...

Share This Page